On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.
I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
Exactly. The problem occurs when I've not scanned the BOSL
documentation enough to even know that something I'm trying to do is
possible with BOSL
On 8/17/2023 12:07 PM, larry wrote:
On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.
I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
FWIW, I haven’t learned to use BOSL2
Just using basic BOSL2 ideas instantly made my code far more readable. Readability is virtually the same and saying it easier to write as well. Just the functions up/down, right/left, fwd/back, xrot, yrot and zrot do a huge amount in this direction. Then just add the ability to anchor all the basic shapes at any cardinal point and you have a huge savings of mental energy. All of these basics you can pick up and use in an afternoon. I’m pretty sure you will never go back.
Later on you can start looking for more exotic tools in BOSL2 when you realize you need them. Chances are good you will find what you need.
-Bob
Tucson AZ
On Aug 17, 2023, at 18:56, jon jon@jonbondy.com wrote:
Exactly. The problem occurs when I've not scanned the BOSL documentation enough to even know that something I'm trying to do is possible with BOSL
On 8/17/2023 12:07 PM, larry wrote:
On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.
I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
when I read the bosl wiki I always meet these "anchors" and I don't understand the idea behind. Could anyone explain that to a dummy user :-) ????
many thanks in advance
Karl
Am 17. August 2023 21:32:32 MESZ schrieb Bob Carlson bob@rjcarlson.com:
FWIW, I haven’t learned to use BOSL2
Just using basic BOSL2 ideas instantly made my code far more readable. Readability is virtually the same and saying it easier to write as well. Just the functions up/down, right/left, fwd/back, xrot, yrot and zrot do a huge amount in this direction. Then just add the ability to anchor all the basic shapes at any cardinal point and you have a huge savings of mental energy. All of these basics you can pick up and use in an afternoon. I’m pretty sure you will never go back.
Later on you can start looking for more exotic tools in BOSL2 when you realize you need them. Chances are good you will find what you need.
-Bob
Tucson AZ
On Aug 17, 2023, at 18:56, jon jon@jonbondy.com wrote:
Exactly. The problem occurs when I've not scanned the BOSL documentation enough to even know that something I'm trying to do is possible with BOSL
On 8/17/2023 12:07 PM, larry wrote:
On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.
I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
Diese Nachricht wurde von unterwegs gesendet...
I don't know if this will help you or confuse you more (and if it's the
latter, I apologize in advance), but here's how I see attachments in BOSL2:
In vanilla openscad, shapes can have children in a hierarchy: a cube can be
a child of a sphere. On its own, that's something like:
module c_child(arg) {
sphere(d=arg);
children();
}
c_child(10)
cube([6, 10, 2]);
...which puts a sphere at [0,0,0] and a rectangular shape jutting back and
to the right from the sphere. Basic child hierarchy, yes? Now, if you need
to position that cube into a particular place, like the sphere's
x-positive-most point, you can do that with a vanilla translate, like:
c_child(10)
translate([5, -5, 0])
cube([6, 10, 2]);
...which moves that cube relative to where it was. It only can move it
relative to where it was though, and doesn't really have a good sense to
know where the boundary of the sphere is, so you have to KNOW where the
sphere boundaries are if you want to place the cube at the sphere's edge.
What BOSL2 attachments do is make that joining of shapes way easier. Shapes
made with BOSL2 are coupled with geometry that describes that shape: its
radius, its cuboid boundary box, a cone, whatever. That geometry is
available to child shapes as you model, in a form of a scoped $var (I think
it's properly called its $parent_geom). When you "attach" one shape to
another, what BOSL2 is doing for you is translating, rotating, &
reorienting child shapes to meet the points on the parent shape. Instead of
using a translate()
and a rotate()
and all manner of obnoxious math,
attach()
does that work for you. BOSL2 creates a series of built-in
cardinal anchor points (such as TOP, LEFT, BACK) and allows you to specify
them symbolically to get the desired shape; you can also combine them to
represent edges, or points. The above example to place a cube of a specific
size to the right-hand face of a sphere would be done like so:
include <BOSL2/std.scad>
sphere(r=10)
attach(RIGHT, LEFT)
cuboid([6, 10, 2]);
For that one simple example, it's not much. But imagine you're creating
30-40 custom shapes, and using those in tens to hundreds of various models.
The translation math alone for that would have killed me if I had to do it
manually!
And that's just the built-in, cardinal attachment points - when you create
models, you can implement your own anchor points for attachments as needed,
named whatever you want. I've got a one-off library that does just that:
the openscad_pvc library (
https://github.com/jon-gilbert/openscad_pvc/wiki/openscad_pvc.scad )
implements BOSL2 attachments in a really really simple manner: PVC
components attach A
to A
, or A
to B
, or B
to B
, as needed by
the modeler, to rapidly lay out PVC components for construction: each
component has at least one named anchor to connect to another. There's some
simple examples in the project's wiki that show how those parts fit
together.
So: vanilla openscad, powerful yes but omg tracking coordinates for joining
shapes is a nightmare; BOSL2 attachments, I find extremely intuitive and
easy to work with.
On Thu, Aug 17, 2023 at 1:43 PM karl.exler@meinklang.cc wrote:
when I read the bosl wiki I always meet these "anchors" and I don't
understand the idea behind. Could anyone explain that to a dummy user :-)
????
many thanks in advance
Karl
Am 17. August 2023 21:32:32 MESZ schrieb Bob Carlson bob@rjcarlson.com:
FWIW, I haven’t learned to use BOSL2
Just using basic BOSL2 ideas instantly made my code far more readable.
Readability is virtually the same and saying it easier to write as well.
Just the functions up/down, right/left, fwd/back, xrot, yrot and zrot do a
huge amount in this direction. Then just add the ability to anchor all the
basic shapes at any cardinal point and you have a huge savings of mental
energy. All of these basics you can pick up and use in an afternoon. I’m
pretty sure you will never go back.
Later on you can start looking for more exotic tools in BOSL2 when you
realize you need them. Chances are good you will find what you need.
-Bob
Tucson AZ
On Aug 17, 2023, at 18:56, jon jon@jonbondy.com wrote:
Exactly. The problem occurs when I've not scanned the BOSL documentation
enough to even know that something I'm trying to do is possible with BOSL
On 8/17/2023 12:07 PM, larry wrote:
On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.
I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
Diese Nachricht wurde von unterwegs gesendet...
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
This tutorial may be helpful:
-Revar
On Aug 17, 2023, at 1:43 PM, karl.exler@meinklang.cc wrote:
when I read the bosl wiki I always meet these "anchors" and I don't understand the idea behind. Could anyone explain that to a dummy user :-) ????
many thanks in advance
KarlAm 17. August 2023 21:32:32 MESZ schrieb Bob Carlson <bob@rjcarlson.com>:
FWIW, I haven’t learned to use BOSL2
Just using basic BOSL2 ideas instantly made my code far more readable. Readability is virtually the same and saying it easier to write as well. Just the functions up/down, right/left, fwd/back, xrot, yrot and zrot do a huge amount in this direction. Then just add the ability to anchor all the basic shapes at any cardinal point and you have a huge savings of mental energy. All of these basics you can pick up and use in an afternoon. I’m pretty sure you will never go back.
Later on you can start looking for more exotic tools in BOSL2 when you realize you need them. Chances are good you will find what you need.
-Bob
Tucson AZOn Aug 17, 2023, at 18:56, jon <jon@jonbondy.com> wrote:
Exactly. The problem occurs when I've not scanned the BOSL documentation enough to even know that something I'm trying to do is possible with BOSL
On 8/17/2023 12:07 PM, larry wrote:
On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
_______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org--
Diese Nachricht wurde von unterwegs gesendet..._______________________________________________
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
It’s best to first think of anchors as points on the object. TOP is the point at the TOP of the object. The X axis is LEFT and RIGHT (right being +X). The Y axis is FRONT/BACK, with FRONT being -Y. FRONT being the negative Y is a little confusing at first, but makes sense when you visualize it. It’s the result of +X being RIGHT.
For all the basic shapes you can say cube([2,3,4], anchor = TOP) for example. This places the named anchor TOP at the origin. So the cube is centered on XY and below the XY plane.
Now you can "add” anchor values, so cube([2,3,4], anchor = TOP + RIGHT) places the cube with the center of its top right hand edge at the origin. Every 3D shape in BOSL2 has these anchors defined.
Next you can do all transfers in BOSL2 using up(), down(), left(), right(), fwd(), back(). So it you need any edge or vertex of the cube positioned on any axis. These make for much more readable (and thus writable) code.
Anchors can do much fancier things like attachment, but don’t even look at that stuff until you are really comfortable with OpenScad and the BOSL2 basics.
-Bob
Tucson AZ
On Aug 17, 2023, at 22:43, karl.exler@meinklang.cc wrote:
when I read the bosl wiki I always meet these "anchors" and I don't understand the idea behind. Could anyone explain that to a dummy user :-) ????
many thanks in advance
Karl
Am 17. August 2023 21:32:32 MESZ schrieb Bob Carlson <bob@rjcarlson.com mailto:bob@rjcarlson.com>:
FWIW, I haven’t learned to use BOSL2
Just using basic BOSL2 ideas instantly made my code far more readable. Readability is virtually the same and saying it easier to write as well. Just the functions up/down, right/left, fwd/back, xrot, yrot and zrot do a huge amount in this direction. Then just add the ability to anchor all the basic shapes at any cardinal point and you have a huge savings of mental energy. All of these basics you can pick up and use in an afternoon. I’m pretty sure you will never go back.
Later on you can start looking for more exotic tools in BOSL2 when you realize you need them. Chances are good you will find what you need.
-Bob
Tucson AZ
On Aug 17, 2023, at 18:56, jon jon@jonbondy.com wrote:
Exactly. The problem occurs when I've not scanned the BOSL documentation enough to even know that something I'm trying to do is possible with BOSL
On 8/17/2023 12:07 PM, larry wrote:
On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.
I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
Diese Nachricht wurde von unterwegs gesendet...
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org mailto:discuss-leave@lists.openscad.org
Those interested in BOSL2 attachments may want to read the tutorial, which
I didn't see mentioned:
https://github.com/BelfrySCAD/BOSL2/wiki/Tutorial-Attachments
On Thu, Aug 17, 2023 at 5:15 PM Jonathan Gilbert jong@jong.org wrote:
I don't know if this will help you or confuse you more (and if it's the
latter, I apologize in advance), but here's how I see attachments in BOSL2:
In vanilla openscad, shapes can have children in a hierarchy: a cube can
be a child of a sphere. On its own, that's something like:
module c_child(arg) {
sphere(d=arg);
children();
}
c_child(10)
cube([6, 10, 2]);
...which puts a sphere at [0,0,0] and a rectangular shape jutting back and
to the right from the sphere. Basic child hierarchy, yes? Now, if you need
to position that cube into a particular place, like the sphere's
x-positive-most point, you can do that with a vanilla translate, like:
c_child(10)
translate([5, -5, 0])
cube([6, 10, 2]);
...which moves that cube relative to where it was. It only can move it
relative to where it was though, and doesn't really have a good sense to
know where the boundary of the sphere is, so you have to KNOW where the
sphere boundaries are if you want to place the cube at the sphere's edge.
What BOSL2 attachments do is make that joining of shapes way easier.
Shapes made with BOSL2 are coupled with geometry that describes that shape:
its radius, its cuboid boundary box, a cone, whatever. That geometry is
available to child shapes as you model, in a form of a scoped $var (I think
it's properly called its $parent_geom). When you "attach" one shape to
another, what BOSL2 is doing for you is translating, rotating, &
reorienting child shapes to meet the points on the parent shape. Instead of
using a translate()
and a rotate()
and all manner of obnoxious math,
attach()
does that work for you. BOSL2 creates a series of built-in
cardinal anchor points (such as TOP, LEFT, BACK) and allows you to specify
them symbolically to get the desired shape; you can also combine them to
represent edges, or points. The above example to place a cube of a specific
size to the right-hand face of a sphere would be done like so:
include <BOSL2/std.scad>
sphere(r=10)
attach(RIGHT, LEFT)
cuboid([6, 10, 2]);
For that one simple example, it's not much. But imagine you're creating
30-40 custom shapes, and using those in tens to hundreds of various models.
The translation math alone for that would have killed me if I had to do it
manually!
And that's just the built-in, cardinal attachment points - when you create
models, you can implement your own anchor points for attachments as needed,
named whatever you want. I've got a one-off library that does just that:
the openscad_pvc library (
https://github.com/jon-gilbert/openscad_pvc/wiki/openscad_pvc.scad )
implements BOSL2 attachments in a really really simple manner: PVC
components attach A
to A
, or A
to B
, or B
to B
, as needed by
the modeler, to rapidly lay out PVC components for construction: each
component has at least one named anchor to connect to another. There's some
simple examples in the project's wiki that show how those parts fit
together.
So: vanilla openscad, powerful yes but omg tracking coordinates for
joining shapes is a nightmare; BOSL2 attachments, I find extremely
intuitive and easy to work with.
On Thu, Aug 17, 2023 at 1:43 PM karl.exler@meinklang.cc wrote:
when I read the bosl wiki I always meet these "anchors" and I don't
understand the idea behind. Could anyone explain that to a dummy user :-)
????
many thanks in advance
Karl
Am 17. August 2023 21:32:32 MESZ schrieb Bob Carlson bob@rjcarlson.com:
FWIW, I haven’t learned to use BOSL2
Just using basic BOSL2 ideas instantly made my code far more readable.
Readability is virtually the same and saying it easier to write as well.
Just the functions up/down, right/left, fwd/back, xrot, yrot and zrot do a
huge amount in this direction. Then just add the ability to anchor all the
basic shapes at any cardinal point and you have a huge savings of mental
energy. All of these basics you can pick up and use in an afternoon. I’m
pretty sure you will never go back.
Later on you can start looking for more exotic tools in BOSL2 when you
realize you need them. Chances are good you will find what you need.
-Bob
Tucson AZ
On Aug 17, 2023, at 18:56, jon jon@jonbondy.com wrote:
Exactly. The problem occurs when I've not scanned the BOSL
documentation enough to even know that something I'm trying to do is
possible with BOSL
On 8/17/2023 12:07 PM, larry wrote:
On Thu, 2023-08-17 at 08:28 +0100, Roger Whiteley via Discuss wrote:
FWIW, I haven’t learned to use BOSL2, it’s hard enough to learn
OpenSCAD at a beginners level.
I always recommend BOSL2 to people, be they experienced or not in
OpenSCAD. The Wiki has SO many great examples that it is usually easy
to choose an example you can modify for your own purposes.
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
Diese Nachricht wurde von unterwegs gesendet...
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org
--
OpenSCAD mailing list
To unsubscribe send an email to discuss-leave@lists.openscad.org