You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is a bug (regression) when a loc is specified at the top level. The test_step_export does not catch the failure because the top level locations are either (0, 0, 0) or applied to a nested assy.
You can see that in the simple_assy fixture the top level loc is ignored when visualizing the assembly in cq-editor (because it calls toCAF).
Another way to reproduce the issue is to compare the origin of an assembly as exported to STL (toCompound) vs STEP (toCAF) when a top level loc is specified. This points to an issue with toCAF.
The following example has no issue. The compound and assembly visualized in cq-editor show the same origin.
Say I'd like to change the origin. Here a location is applied at the top level.
The compound and assembly results are now different. The result is not expected.
importcadqueryascqfromcadquery.occ_impl.shapesimport*# a table; origin is centered under tablew=1200l=700h=800t=25leg_w=40leg_l=60leg=box(leg_w, leg_l, h)
top=box(w, l, t)
assy= (
cq.Assembly(
loc=cq.Location((-w/2, -l/2, 0))
) # origin is centered under table top
.add(leg, name="leg0", loc=cq.Location((leg_w/2, leg_l/2, 0)))
.add(leg, name="leg1", loc=cq.Location((w-leg_w/2, leg_l/2, 0)))
.add(leg, name="leg2", loc=cq.Location((leg_w/2, l-leg_l/2, 0)))
.add(leg, name="leg3", loc=cq.Location((w-leg_w/2, l-leg_l/2, 0)))
.add(top, name="top", loc=cq.Location((w/2, l/2, h)))
)
comp=assy.toCompound()
show_object(comp, name="comp")
show_object(assy, name="assy")
The text was updated successfully, but these errors were encountered:
In focusing on the color fix of PR #1157, I may have overlooked the importance of this comment as no tests had failed:
#1170 (comment)
There is a bug (regression) when a loc is specified at the top level. The
test_step_export
does not catch the failure because the top level locations are either (0, 0, 0) or applied to a nested assy.You can see that in the
simple_assy
fixture the top level loc is ignored when visualizing the assembly in cq-editor (because it callstoCAF
).Another way to reproduce the issue is to compare the origin of an assembly as exported to STL (
toCompound
) vs STEP (toCAF
) when a top level loc is specified. This points to an issue withtoCAF
.The following example has no issue. The compound and assembly visualized in cq-editor show the same origin.
Say I'd like to change the origin. Here a location is applied at the top level.
The compound and assembly results are now different. The result is not expected.
The text was updated successfully, but these errors were encountered: