Skip to content

How to change the origin of a importet .stl model to its center #40

Answered by jimy-byerley
Boehm92 asked this question in Q&A
Discussion options

You must be logged in to vote

Hello

For imported meshes, madcad is not changing the origin, it simply import points coordinates as they are stored in the file, which means the software that produced your cylinders actually placed the origin on the corner (the solidworks' mesher ?). I agree such an origin placement is not convenient for a cylinder ;)

Also you can fix that origin by translating one or both mesh of what is necessary (the radius)

# translating both
difference(
    ring_big .transform(-ring_big_radius*vec3(1,1,0)),
    ring_small .transform(-ring_small_radius*vec3(1,1,0)),
    )
# translating only one
difference(
    ring_big .transform(),
    ring_small .transform((ring_big_radius-ring_small_radius)*vec3(1,1

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Boehm92
Comment options

Answer selected by Boehm92
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants