summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-12-28 01:34:00 (GMT)
committerWerner Almesberger <werner@almesberger.net>2016-12-28 01:34:00 (GMT)
commit1236c80eb2f5c736a5e78fd52f138cd28b3650d5 (patch)
tree6844222025920c973045389fb63224b39bac4e08
parent753c04c2af29a2fead8261eb3f82f8bac18a93c0 (diff)
downloadmisc-1236c80eb2f5c736a5e78fd52f138cd28b3650d5.zip
misc-1236c80eb2f5c736a5e78fd52f138cd28b3650d5.tar.gz
misc-1236c80eb2f5c736a5e78fd52f138cd28b3650d5.tar.bz2
spacer/spacer.py: add chamfer and fillet on top edges of 3D-printed version
-rwxr-xr-xspacer/spacer.py24
1 files changed, 21 insertions, 3 deletions
diff --git a/spacer/spacer.py b/spacer/spacer.py
index f9423c2..4e2cb1e 100755
--- a/spacer/spacer.py
+++ b/spacer/spacer.py
@@ -2,6 +2,7 @@
from math import sin, cos, acos, hypot, sqrt, pi
from cad import *
+import FreeCADGui, Mesh
#
# Vertical stacking:
@@ -525,13 +526,30 @@ if True:
frame = frame.fuse(s_in)
frame = frame.fuse(s_out)
+ if not cnc:
+ frame.rotate(v(0, 0, 0), v(0, 1, 0), 180)
visualize(doc, frame, "Frame", (1.0, 1.0, 1.0), 50)
if cnc:
visualize(doc, fill, "Fillers", (1.0, 1.0, 1.0), 80)
if cnc:
export = frame.fuse(fill)
+ export.exportStl("spacer.stl")
else:
- frame.rotate(v(0, 0, 0), v(0, 1, 0), 180)
- export = frame
- export.exportStl("spacer.stl")
+ ch = FreeCAD.ActiveDocument.addObject("Part::Chamfer",
+ "Chamfer")
+ fr = FreeCAD.ActiveDocument.Frame
+ ch.Base = fr
+ ch.Edges = [(148, 0.60, 1.20)]
+# fr.Visibility = False
+ FreeCADGui.ActiveDocument.Frame.Visibility = False
+ FreeCAD.ActiveDocument.recompute()
+
+ fi = FreeCAD.ActiveDocument.addObject("Part::Fillet", "Fillet")
+ fi.Base = ch
+ fi.Edges = [(58, 0.5, 0.5)]
+# ch.Visibility = False
+ FreeCADGui.ActiveDocument.Chamfer.Visibility = False
+ FreeCAD.ActiveDocument.recompute()
+
+ Mesh.export([ FreeCAD.ActiveDocument.Fillet ], "spacer.stl")