Skip to content
This repository has been archived by the owner on Feb 9, 2021. It is now read-only.

translate() Seems to Get Axes Mixed Up #60

Closed
jmwright opened this issue Dec 13, 2014 · 2 comments
Closed

translate() Seems to Get Axes Mixed Up #60

jmwright opened this issue Dec 13, 2014 · 2 comments
Labels

Comments

@jmwright
Copy link
Collaborator

When I run the following code, the part is translated along the Y-axis instead of the X-axis. Am I missing something similar to toLocalCoords?

step_location = '/home/jwright/Documents/Projects/Switch/vendor/SS_01GL_E.step'
self.elec_switch = importers.importStep(step_location)
self.elec_switch = self.elec_switch.combine().translate((10, 0, 0))

If I do the following in FreeCAD, the part is translated properly along the X-axis.

new_part = Part.read('/home/jwright/Documents/Projects/Switch/vendor/SS_01GL_E.step')
new_part.translate((10, 0, 0))

CQ's translate seems to use FreeCAD's translate under the hood, so I'm not sure where this swapping of axes is coming from.

@dcowden
Copy link
Owner

dcowden commented Dec 13, 2014

Off hand I don't know. I'll have a look when I get a chance (probably
tonight)
On Dec 12, 2014 10:17 PM, "Jeremy Wright" notifications@github.com wrote:

When I run the following code, the part is translated along the Y-axis
instead of the X-axis. Am I missing something similar to toLocalCoords?

step_location = '/home/jwright/Documents/Projects/Switch/vendor/SS_01GL_E.step'self.elec_switch = importers.importStep(step_location)self.elec_switch = self.elec_switch.combine().translate((10, 0, 0))

If I do the following in FreeCAD, the part is translated properly along
the X-axis.

new_part = Part.read('/home/jwright/Documents/Projects/Switch/vendor/SS_01GL_E.step')
new_part.translate((10, 0, 0))

CQ's translate seems to use FreeCAD's translate under the hood, so I'm not
sure where this swapping of axes is coming from.


Reply to this email directly or view it on GitHub
#60.

@jmwright
Copy link
Collaborator Author

I was calling translate and then rotate on a solid. If I reverse it so that translate is called after rotate this problem goes away.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants