Functions such as PrismaticToroid require facilities in the FreeCAD version 0.20 of Part
It can be installed via the Addon Manager (from Tools menu)
Clone into FreeCAD's Mod directory see https://wiki.freecadweb.org/Installing_more_workbenches
-
Change to FreeCAD Mod directory
-
git clone https://github.com/KeithSloan/OpenSCAD_Alt_Import.git
-
Start/Restart FreeCAD
The idea to allow hybrid development ( FreeCAD and OpenSCAD )
-
Importing SCAD files as FreeCAD Objects.
-
Edit SCADObjects with an external editor
-
Import of Minkowski request with a Sphere as a Part::Offset
-
Import of Minkowski request with a Cylinder as Part::Offset & Part::Fillet
-
Matt Considine's improvements utilizing python EZdxf library
- OpenSCAD DXF import
- DXF importer
- Now supports DXF files with INSERT tag.
-
For test files see directory testDXFfiles
-
Test of test files see Macro Macros/testSCAD_DXFfile.FCMacro ( Copy to FreeCAD Macro's directory )
-
If problems please report and drop back to main FreeCAD importer.
-
Note: If the scad file imports external files use one of
New Importer : SCAD (importCSG) New Importer : SCADFileObject
New Importer : SCADObject currently does not support import of external files
For a number of years OpenSCAD has supported an External Editor
To use an external editor for SCADObjects
You need to add a parameter to the OpenSCAD workbench
FreeCAD | Tools | Edit parameters
Group : Base App
Preferences
Mod
OpenSCAD
externalEditor
Text : <path to editor >
e.g. Text /usr/local/bin/code
With the workbench installed when opening a CSG or SCAD File with
FreeCAD | File | Open
the user will be prompted with which importer to use.
- SCAD (ImportCSG) : Uses OpenSCAD to convert SCAD file to CSG and then import as FreeCAD Brep Objects
- SCADFileObject (ImportFileSCAD) : Imports as a FreeCAD SCADObject. Source remains the original file.
- SCADObject (ImportSCAD) : File is copied into FreeCAD and saved with FreeCAD file.
- Minkowski
Minkowski requests where the second object is a Sphere or Cyclinder is handled as follows
Sphere
$fn=50;
minkowski()
{
cube([10,10,1]);
sphere(1);
}
Produces a suitable Part::Offset of the first Object i.e with rounded edges.
Cylinder
$fn=50;
minkowski()
{
cube([10,10,1]);
cylinder(r=2,h=1);
}
Produces an Part::Fillet of a suitable Part::Offset of the first Object, fillet radius that of the cylinder.
Where the FreeCAD has an editable Fillet
-
Hull A limited number of hull requests are converted to BREP equivalents
- Collinear cylinders & cones - Two Spheres - Two Parallel Cylinders of equal length, orthogonaly displaced. others are dealt with as per standard importer i.e passed to OpenSCAD executable to create a Mesh
Created from imported File - Only file reference is saved with the FreeCAD Document
Properties
- edit : Toggling will invoke the external editor.
- execute : Will process the SCAD source ( Object or File ) to create a the Objects Shape.
- message : Any error messages from OpenSCAD.
- mode : Brep or Mesh.
- timeout : time out value for operations passed to OpenSCAD.
- source : Source file name
- source File : Path to source file (ImportFileSCAD)
OpenSCAD is used to create a CSG version that is then imported into a Work document as FreeCAD Objects. The Work document is processed to create/update the SCADObjects Shape as a Single Part::Compound
Brep Propertries
- fnmax : Sets the fnmax parameter for the CSG import of this Object
- keep_work : Option to save or close the Work document
OpenSCAD is used to create a STL version that is imported to create/update the SCADObjects Shape.
Mesh Properties
- mesh_recombine : For future option
Created from imported file - Saved using JSON with the FreeCAD document
For creating FreeCAD objects from SCAD source. Should avoid SCAD files that depend on other files i.e. Have use or include statements.
Properties : See SCADFileObjects properties.
Using a combination of an external editor for SCADObjects and having OpenSCAD set up for an external editor allows.
-
One to edit the source for FreeCAD OpenSCAD objects
-
Preview any changes in a OpenSCAD Preview window
-
When happy with source definition
- Save SCAD Source file
- Toggle SCADObjects - execute property to have changes brought into FreeCAD
The performance of OpenSCAD Preview has been significantly improved since Feb 2022
OpenSCAD 3D rendering just got an order of magnitude faster
- mconsidine
- wmayer
- chennes
- edwilliams16
- onekk