From 48343f06d2198ff115080d5d41c6d4224b04b2d0 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 21 Jun 2025 12:40:32 -0400 Subject: [PATCH 1/4] actually add parts section --- tutorials/Attachment-Parts.md | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 tutorials/Attachment-Parts.md diff --git a/tutorials/Attachment-Parts.md b/tutorials/Attachment-Parts.md new file mode 100644 index 00000000..954ced3b --- /dev/null +++ b/tutorials/Attachment-Parts.md @@ -0,0 +1,50 @@ +# Attachment Parts + +Some objects provide named attachable parts that you can select +instead of using the main geometry for the object. One important kind +of attachable part is the inside of a tube. + +Here is a tube with its anchors shown: + +```openscad-3D +include +tube(id=20,h=15,wall=3) + show_anchors(); +``` + +The anchors are all on the outside wall of the tube and give you no +method for placing a child **inside** the tube. In order to attach +inside the tube, we select the "inside" part using the `attach_part()` +module. + + +```openscad-3D +include +tube(id=20,h=15,wall=3) + attach_part("inside") + align(BACK,TOP) + color("lightblue") cuboid(4); +``` + +Now when we align the cube to the BACK wall of the tube it appears on +the inside of the tube. If you need to attach to both the inside and +outside you can place some attachments using `attach_part()` and some +with the standard attachment geometry on the outside like this: + +```openscad-3D +include +diff() +tube(id=20,h=15,wall=3){ + attach([1,-1/2],BOT) + color("green")cyl(d=4,h=3,$fn=12); + attach_part("inside"){ + attach(LEFT,BOT,align=TOP) + color("lightblue")cuboid(4); + attach(BACK,CTR,align=TOP,inside=true, inset=-0.1) + cuboid(4); + } +} +``` + + + From cf2f82a56f9ceb2b8c337f7e1210bbf7ff3e9b8d Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 21 Jun 2025 12:44:57 -0400 Subject: [PATCH 2/4] minor edits --- tutorials/Attachment-Making.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tutorials/Attachment-Making.md b/tutorials/Attachment-Making.md index d7944e97..023ceedb 100644 --- a/tutorials/Attachment-Making.md +++ b/tutorials/Attachment-Making.md @@ -558,10 +558,10 @@ module tetrahedron(base, height, spin=0, anchor=FWD+LEFT+BOT, orient=UP) tetrahedron(20,18) show_anchors(); ``` -For this module we have used VNF anchors, but this tetrahedron is half -related to a cuboid, so maybe sometimes you prefer to use anchors -based on the bounding box. You could create a module with bounding -box anchors like this, where we have had to explicitly center the VNF +For this module we have used VNF anchors, but this tetrahedron is the +corner of a cuboid, so maybe sometimes you prefer to use anchors +based on the corresponding cuboid (its bounding box). You can create a module with bounding +box anchors like this, where we have explicitly centered the VNF to make it work with the prismoid type anchoring: ```openscad-3D From df4f3acca821659c9aec3df26f91063fa6ff4aff Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 21 Jun 2025 12:46:11 -0400 Subject: [PATCH 3/4] more edits --- tutorials/Attachment-Making.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/Attachment-Making.md b/tutorials/Attachment-Making.md index 023ceedb..9ed70fbf 100644 --- a/tutorials/Attachment-Making.md +++ b/tutorials/Attachment-Making.md @@ -625,8 +625,8 @@ an attachable part called "inside" that lets you attach to the inside of the tube. Below we create an example where an object is made from two -cylindrical parts, and we want to be able to attach to either one. -In order to create attchable parts you must pass a list of the parts +cylindrical parts, and we want to be able to attach to either +one. In order to create attchable parts you must pass a list of the parts to `attachable()`. You create a part using the `define_part()` function which requires the part's name and its geometry. You can optionally provide a transformation using the `T=` parameter and give From 23b8239e8c9185f14712ed56d62d98c4cb21d910 Mon Sep 17 00:00:00 2001 From: Adrian Mariano Date: Sat, 21 Jun 2025 12:47:49 -0400 Subject: [PATCH 4/4] even more --- tutorials/Attachment-Making.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tutorials/Attachment-Making.md b/tutorials/Attachment-Making.md index 9ed70fbf..22c2b2f0 100644 --- a/tutorials/Attachment-Making.md +++ b/tutorials/Attachment-Making.md @@ -666,7 +666,7 @@ the cylinder is located relative to the part's overall geometry. If you create an "inside" part for a tube, the inside object will naturally have its anchors on the inner cylinder **pointing outward**. You can anchor on the inside by setting `inside=true` when -invoking `attach()` or `align()`, but another option set `inside=true` -when creating the part with `define_part()`. This cause `align()` and +invoking `attach()` or `align()`, but another option is to set `inside=true` +with `define_part()`. This marks the geometry as an inside geometry, which cause `align()` and `attach()` to invert the meaning of the `inside` parameter so that objects will attach on the inside by default.