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
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
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.
SCADObject (ImportSCAD) : File is copied into FreeCAD and saved with FreeCAD file.
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
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
OpenSCAD is used to create a STL version that is imported to create/update the SCADObjects Shape.
Mesh Properties
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
Example Screenshot.
The performance of OpenSCAD Preview has been significantly improved since Feb 2022
OpenSCAD 3D rendering just got an order of magnitude faster