Help understanding position+attach+anchor #1817
-
|
Hi there, I'm learning OpenSCAD+BOSL2 and I've got a simple case where I don't understand why the cubes aren't placed at Z=0. I suspect, I'm missing something conceptual. Here's a quick snippet to illustrate the case: Any ideas why the small cube is placed at Z=-5 (half of it's height)? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
|
Have you read the attachments tutorial? It never occurred to me to try to mix position() with attach() like that. You're best off picking one or the other. To understand what's happening comment out position() and see what you get. Adding position means shifting the origin of the child coordinate system to the specified location, BOTTOM, in this case, so everything will go down by half the height of the parent cube. But you should use either attach() only or align() only and I think you should be less confused. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for your reply @adrianVmariano - this helps. From the three options I like align() the best for this case: |
Beta Was this translation helpful? Give feedback.


Have you read the attachments tutorial?
It never occurred to me to try to mix position() with attach() like that. You're best off picking one or the other. To understand what's happening comment out position() and see what you get. Adding position means shifting the origin of the child coordinate system to the specified location, BOTTOM, in this case, so everything will go down by half the height of the parent cube. But you should use either attach() only or align() only and I think you should be less confused.