BOSL2 icon indicating copy to clipboard operation
BOSL2 copied to clipboard

attachment tutorial suggestions

Open adrianVmariano opened this issue 4 years ago • 3 comments

Clearly state multiple times the axis that spin operates around, because this is unexpected/non-intuitive. Cylinder example should show the spin=0 case as transparent object or second example for clarity. Show example where the spin axis is not vertical. What is a use case for spin?

Document use of and difference (if any) of attach(TOP,BOTTOM) vs attach(TOP) thing(anchor=BOTTOM). If they are equivalent say so and if not say what's different (or make them equivalent??)

Show example of new orient module and specifically its use for putting a child object aligned on the edge of a cube.

adrianVmariano avatar Aug 01 '21 22:08 adrianVmariano

I was surprised by the behavior of

cuboid(100){
  attach(CENTER,CENTER)
    cyl(r1=40,r2=0, h=175);
  }

though it does make sense once you think that the CENTER anchors point up. I suggest a specific example of this.

adrianVmariano avatar Aug 02 '21 20:08 adrianVmariano

After further experimentation I found that attach(TOP,BACK) thing() and attach(TOP) thing(anchor=BACK) are not at all the same. I think you should consider reorganizing the attaching things section of the tutorial to first describe that children are positioned at the "center". Then show what happens if you add an anchor to the child (namely it changes the center of the child).

Next introduce position() to show how you can control where the object appears on the parent.

And only after that, introduce attach(). Use the analogy of an ant on the surface of the object for attach to explain the concept of the local coordinate system. Explain more clearly what generally happens at corners (how the coordinate system is defined there). Explain the difference between

cylinder(h=20,r=10)
attach(FRONT,BACK)
up(10)
cube([10,5,20]);

and

cylinder(h=20,r=10)
up(10)
attach(FRONT,BACK)
cube([10,5,20]);

And when you introduce anchor with a second position like anchor(TOP,BACK) mention that the second given anchor direction overrides any anchor given in the child. So anchor(TOP,BACK) thing(anchor=BOTTOM) ignores the given BOTTOM anchor.

adrianVmariano avatar Aug 14 '21 15:08 adrianVmariano

Also using attach() with a second arg ignores the orient argument of the child.

adrianVmariano avatar May 01 '22 16:05 adrianVmariano

attachments tutorial is out of date at this point---the tagging section is wrong in some places.

Also there need to be attachment examples where an object is moved like position() up() thing(). I emailed someone who didn't think that would be possible.

adrianVmariano avatar Oct 22 '22 23:10 adrianVmariano