-
Hello, I want to scale the imported model according to its size. But I wonder how to get the objects' size after importing from step/dxf files? For example: model = cq.importers.importStep("model.stp") |
Beta Was this translation helpful? Give feedback.
Answered by
jmwright
Jan 11, 2023
Replies: 1 comment 2 replies
-
You can get the size of an object via the BoundingBox in this way. import cadquery as cq
result = cq.Workplane().box(10, 20, 30)
cq.exporters.export(result, "model.step")
model = cq.importers.importStep("model.step")
for o in model.objects:
log(o.BoundingBox().xlen) # prints 10.0
log(o.BoundingBox().ylen) # prints 20.0
log(o.BoundingBox().zlen) # prints 30.0 |
Beta Was this translation helpful? Give feedback.
2 replies
Answer selected by
adam-urbanczyk
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can get the size of an object via the BoundingBox in this way.