Is center() broken or am I?

  • Trying out V2 stuff...

    pin = center({axes:[true,true,false]}, cylinder({startRadius: 4.5, endRadius: 4.5, height: 38}))

    produces the same object in the same place as:

    pin = cylinder({startRadius: 4.5, endRadius: 4.5, height: 38})

    I would have expected the first one to be centered on X/Y and sitting on the Z plane. Am I missing something?

    Also, do I have to always define 'startRadius' and 'endRadius' for a cylinder? I would think there would be a 'radius'. Maybe I'm just lazy...

  • And the answer is... I'm broke 😌
    I was treating the center({axes:[true, true, false]}, object) like the old object({center:[true,true,false]}) which is not the case since primitives are now created centered at [0,0,0] by default.
    Since the primitive is created centered by default at [0,0,0], changing the axes on a new part doesn't really have an effect.
    Picking a consistent default is probably the 'right thing(tm)' to do since the old primitives where very inconsistent - round things like cylinders and sphere where centered on X/Y but not Z and cubes where created with a corner at [0,0,0].
    Hopefully new docs will have little warnings for those transitioning from V1 to V2 and maybe some helpful examples for porting old designs over.

Log in to reply