Did something changed regarding units from 7.7 to 7.8 #351
Answered
by
dpasukhi
adam-urbanczyk
asked this question in
Q&A
-
The following code used to work with 7.7 from OCP import Interface, STEPControl, gp, BRepBuilderAPI
# make a point
pnt = gp.gp_Pnt(1, 0, 0)
vertex = BRepBuilderAPI.BRepBuilderAPI_MakeVertex(pnt).Vertex()
# instantiate writer
w = STEPControl.STEPControl_Writer()
# set units
model_units = 'MM'
output_units = 'M'
if not Interface.Interface_Static.SetCVal_s('xstep.cascade.unit', model_units):
raise ValueError
if not Interface.Interface_Static.SetCVal_s('write.step.unit', output_units):
raise ValueError
# transfer shapes and write
w.Transfer(vertex, STEPControl.STEPControl_AsIs)
w.Write("test.stp") With 7.8 it results in a step containing
Is this a regression/bug? I did not see anything obvious in the release notes. See https://dev.opencascade.org/content/differences-behavior-units-xstepcascadeunit-and-stepcontrolwriter-75-76 for reference. |
Beta Was this translation helpful? Give feedback.
Answered by
dpasukhi
Feb 9, 2025
Replies: 1 comment 13 replies
-
I also tried |
Beta Was this translation helpful? Give feedback.
13 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Well, thank you. It is a bug even for 7.9 (related to ignore the write.step.unit in any cases.
Only applying the scale to the model after creating will be help. My apologies, our tests rely on applying on model that.