mirror of
https://github.com/gittrahan/support-fins.git
synced 2026-10-19 02:10:52 -05:00
fusion: the print frame no longer turns the part 90 degrees -- an XY bed hands the engine the part as the site sees it (v0.6.2)
PrintFrame.from_bed took x = n x ref, so a bed on the XY plane gave print x = world +Y, y = world -X. The engine isn't the same under a turn about z: the headset got 95 walls / 144 tines in Fusion, 93 / 140 on the site and CLI. x is now ref projected onto the bed, so an XY bed is the identity frame. Chairs, lampshade, bunny, gree, bear, zombie, lighthouse and the headset now match the CLI.
This commit is contained in:
1 parent
cc38bfa170
commit
b87759d404
3 files changed
+26
-2
No files matched your search
@@ -6,7 +6,7 @@
|
||||
"description": {
|
||||
"": "printfins.com supports that live in the model. Insert Support Fins: the website's breakaway fins and bed pad under a part's overhangs, from the website's own engine."
|
||||
},
|
||||
"version": "0.6.1",
|
||||
"version": "0.6.2",
|
||||
"runOnStartup": false,
|
||||
"supportedOS": "windows|mac",
|
||||
"editEnabled": true
|
||||
|
||||
@@ -128,8 +128,13 @@ class PrintFrame:
|
||||
|
||||
axes = [adsk.core.Vector3D.create(1, 0, 0), adsk.core.Vector3D.create(0, 1, 0),
|
||||
adsk.core.Vector3D.create(0, 0, 1)]
|
||||
# Print x is the world axis lying flattest on the bed, projected onto it, so
|
||||
# a bed on the XY plane gives print axes = world axes: the part goes to the
|
||||
# engine the way the site sees the same STL. (x = n x ref turned every part
|
||||
# 90 degrees, and the engine's placement isn't the same under a turn.)
|
||||
ref = min(axes, key=lambda a: abs(a.dotProduct(n)))
|
||||
x = n.crossProduct(ref)
|
||||
k = ref.dotProduct(n)
|
||||
x = adsk.core.Vector3D.create(ref.x - k * n.x, ref.y - k * n.y, ref.z - k * n.z)
|
||||
x.normalize()
|
||||
y = n.crossProduct(x)
|
||||
y.normalize()
|
||||
|
||||
@@ -526,6 +526,25 @@ class FusionSide(unittest.TestCase):
|
||||
self.assertAlmostEqual(min(allc[1::3]), 0.3, places=4) # cm, along Y
|
||||
self.assertLessEqual(max(allc[1::3]), max(c / 10.0 for c in yup[1::3]) + 1e-4)
|
||||
|
||||
def test_an_xy_bed_hands_the_engine_the_part_unturned(self):
|
||||
# The site fins the STL as it sits; Fusion must give the engine the same
|
||||
# soup, or placement differs (the headset got 95 walls here, 93 on the site).
|
||||
part = posed(read_stl('lbracket'), 35)
|
||||
design, body = mesh_design(part)
|
||||
frame = fb.PrintFrame.from_bed(design.rootComponent.xYConstructionPlane, body, APP)
|
||||
soup = fb.body_soup(body, frame)
|
||||
self.assertEqual(len(soup), len(part))
|
||||
self.assertLess(max(abs(a - b) for a, b in zip(soup, part)), 1e-4)
|
||||
|
||||
def test_the_print_frame_is_right_handed_on_any_bed(self):
|
||||
design, body = mesh_design(posed(read_stl('lbracket'), 35))
|
||||
for n in ((0, 0, 1), (0, 1, 0), (1, 0, 0), (0.3, -0.5, 0.81)):
|
||||
frame = fb.PrintFrame.from_bed(fake_adsk.ConstructionPlane((0, 0, 0), n), body, APP)
|
||||
x, y, z = (fake_adsk.Vec(*v) for v in (frame.x, frame.y, frame.z))
|
||||
c = x.crossProduct(y)
|
||||
self.assertAlmostEqual(c.dotProduct(z), 1.0, places=9)
|
||||
self.assertAlmostEqual(x.dotProduct(y), 0.0, places=9)
|
||||
|
||||
def test_part_through_the_bed_is_refused_and_floating_is_flagged(self):
|
||||
part = posed(read_stl('lbracket'), 35, (0, 0, -5))
|
||||
design, _ = mesh_design(part)
|
||||
|
||||
Reference in new issue
Block a user