cadquery icon indicating copy to clipboard operation
cadquery copied to clipboard

Importing STEP models on top of transformed workplanes

Open r4dr3fr4d opened this issue 2 years ago • 3 comments

I'd like to import a STEP onto a transformed/rotated workplane, instead of importing it and redoing previous transformations. Is this possible?

r4dr3fr4d avatar Apr 04 '22 01:04 r4dr3fr4d

The importStep() method returns the object as:

    return cq.Workplane("XY").newObject(solids)

so I believe you'll need to translate/rotate the Shape afterwards.

If it's useful to you cq_warehouse contains a Shape.transformed() method that enables translation and rotation in one operation just as the Plane.transformed() method (see https://github.com/gumyr/cq_warehouse/blob/main/src/cq_warehouse/extensions.py#L2049).

gumyr avatar Apr 07 '22 00:04 gumyr

I'm aware that you can transform it after importing. I was wondering if there existed a way to import it onto the current workplane of an object.

r4dr3fr4d avatar Apr 07 '22 01:04 r4dr3fr4d

@r4dr3fr4d There is no way to currently do this. The code assumes a standard XY workplane when importing. Reference

jmwright avatar Apr 11 '22 13:04 jmwright