Created
February 15, 2014 14:03
-
-
Save 5263/9019709 to your computer and use it in GitHub Desktop.
Convert FreeCAD Minkowski Sum Features to Offset Features
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import FreeCAD,OpenSCADFeatures | |
for obj in FreeCAD.ActiveDocument.Objects: | |
if obj.TypeId == "Part::FeaturePython" and hasattr(obj,'Proxy') and isinstance(obj.Proxy,OpenSCADFeatures.CGALFeature) \ | |
and len(obj.Children) == 2: | |
print [(child.TypeId,child.PropertiesList) for child in obj.Children] | |
if obj.Children[0].TypeId in ['Part::Cylinder','Part::Sphere']: | |
OpenSCADFeatures.OffsetShape(obj,obj.Children[1],float(obj.Children[0].Radius)) | |
obj.touch() | |
elif obj.Children[1].TypeId in ['Part::Cylinder','Part::Sphere']: | |
OpenSCADFeatures.OffsetShape(obj,obj.Children[0],float(obj.Children[1].Radius)) | |
obj.touch() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment