OpenSCAD Workbench: Difference between revisions
m (minor corrections) |
|||
Line 5: | Line 5: | ||
[[Image:OpenSCADexamaple1.png|An example of imported OpenSCAD geometry]] |
[[Image:OpenSCADexamaple1.png|An example of imported OpenSCAD geometry]] |
||
It |
It contains an [[OpenSCAD_CSG|Importer]] which allows you to open the [[OpenSCAD_CSG|.csg]] output of OpenSCAD in FreeCAD. |
||
The [[OpenSCAD_CSG|exporter]] outputs a CSG based (sub-)tree to [[OpenSCAD_CSG|.csg]] Geometry |
The [[OpenSCAD_CSG|exporter]] outputs a CSG based (sub-)tree to [[OpenSCAD_CSG|.csg]] Geometry which is not based on CSG operations and will be exported as a mesh. |
||
The OpenSCAD Module |
The OpenSCAD Module contains a toolbox with functions to modify the feature tree and repair models. |
||
== OpenSCAD |
== OpenSCAD language and file format == |
||
The OpenSCAD |
The OpenSCAD language allows the usage of variables and loops. It allows you to specify submodules to reuse geometry and code. This high degree of flexibility makes parsing very complex. Currently the OpenSCAD module in FreeCAD can not handle the OpenSCAD Language by itself. |
||
Instead if |
Instead, if OpenSCAD is installed, it can be used to compile the input to an output format named 'CSG'. It is a subset of the OpenSCAD Language and can be used as the input to OpenSCAD for further processing. |
||
However in this step of compilation all the paramtric behavior is lost. All variable names will be discarded, loops expanded and mathematical expressions evaluated. |
However in this step of compilation all the paramtric behavior is lost. All variable names will be discarded, loops expanded and mathematical expressions evaluated. |
||
Line 19: | Line 19: | ||
== Limitations == |
== Limitations == |
||
OpenSCAD |
OpenSCAD creates constructive solid geometry as well as importing mesh files and extruding 2d geometry (from dxf files). FreeCAD allows you to create CSG with primitives as well. The FreeCAD geometry kernel (OCCT) works on a boundary representation. |
||
Therefore conversion from CSG to BREP should be possible in theory. Whereas |
Therefore conversion from CSG to BREP should be possible in theory. Whereas conversion from BREP to CSG is, in general, not possible. |
||
OpenSCAD works internaly on Meshes. Some operations which are useful on meshes are not meaningful on a BREP model and currently not available. Among these are convex hull, minkowski sum, glide and subdiv. |
OpenSCAD works internaly on Meshes. Some operations which are useful on meshes are not meaningful on a BREP model and currently not available. Among these are convex hull, minkowski sum, glide and subdiv. |
||
OpenSCAD is very tolerant when doing booleans on coincident geometry. The FreeCAD geometry kernel is currently less tolerant. An automatic solution is not available at the moment. Please feel free to post to the forum if you |
OpenSCAD is very tolerant when doing booleans on coincident geometry. The FreeCAD geometry kernel is currently less tolerant. An automatic solution is not available at the moment. Please feel free to post to the forum if you encounter such problems. |
||
== Hints == |
== Hints == |
||
When importing DXF set the Draft precision to a sensible amount as this will affect the detection of connected edges. |
When importing DXF set the Draft precision to a sensible amount as this will affect the detection of connected edges. |
||
If FreeCAD crashed when importing CSG, it is strongly |
If FreeCAD crashed when importing CSG, it is strongly recommended to enable 'automatically check model after boolean operation' in Menu -> Edit -> Preferences -> Part Design -> Model setting |
||
{{languages | {{es|OpenSCAD_Module/es}} {{fr|OpenSCAD_Module/fr}} {{it|OpenSCAD_Module/it}} }} |
{{languages | {{es|OpenSCAD_Module/es}} {{fr|OpenSCAD_Module/fr}} {{it|OpenSCAD_Module/it}} }} |
Revision as of 23:24, 18 September 2012
The OpenSCAD Module is in an early development stage.
The OpenSCAD Module offers interoperability to the open source software OpenSCAD[1].
It contains an Importer which allows you to open the .csg output of OpenSCAD in FreeCAD.
The exporter outputs a CSG based (sub-)tree to .csg Geometry which is not based on CSG operations and will be exported as a mesh. The OpenSCAD Module contains a toolbox with functions to modify the feature tree and repair models.
OpenSCAD language and file format
The OpenSCAD language allows the usage of variables and loops. It allows you to specify submodules to reuse geometry and code. This high degree of flexibility makes parsing very complex. Currently the OpenSCAD module in FreeCAD can not handle the OpenSCAD Language by itself. Instead, if OpenSCAD is installed, it can be used to compile the input to an output format named 'CSG'. It is a subset of the OpenSCAD Language and can be used as the input to OpenSCAD for further processing. However in this step of compilation all the paramtric behavior is lost. All variable names will be discarded, loops expanded and mathematical expressions evaluated.
GUI Commands
Limitations
OpenSCAD creates constructive solid geometry as well as importing mesh files and extruding 2d geometry (from dxf files). FreeCAD allows you to create CSG with primitives as well. The FreeCAD geometry kernel (OCCT) works on a boundary representation. Therefore conversion from CSG to BREP should be possible in theory. Whereas conversion from BREP to CSG is, in general, not possible.
OpenSCAD works internaly on Meshes. Some operations which are useful on meshes are not meaningful on a BREP model and currently not available. Among these are convex hull, minkowski sum, glide and subdiv. OpenSCAD is very tolerant when doing booleans on coincident geometry. The FreeCAD geometry kernel is currently less tolerant. An automatic solution is not available at the moment. Please feel free to post to the forum if you encounter such problems.
Hints
When importing DXF set the Draft precision to a sensible amount as this will affect the detection of connected edges.
If FreeCAD crashed when importing CSG, it is strongly recommended to enable 'automatically check model after boolean operation' in Menu -> Edit -> Preferences -> Part Design -> Model setting