T
TLC123
Sat, Dec 30, 2017 8:53 PM
Nice job Ro. I guess there is a bunch of ways to skin that cat.
I often find there is a difference between cad programming and software
programming in that there is less returned value in the effort to find very
general solutions to a loose set of problems. For me it's usually more
efficient to just find a simple solution to a specific problem. If i
encounter a similar problem again, i just cut an paste the right snippets
rater than librarify it. I maybe make the wrong assumption that probably no
one is going to maintain my code after it has produced the intended
geometry.
--
Sent from: http://forum.openscad.org/
Nice job Ro. I guess there is a bunch of ways to skin that cat.
I often find there is a difference between cad programming and software
programming in that there is less returned value in the effort to find very
general solutions to a loose set of problems. For me it's usually more
efficient to just find a simple solution to a specific problem. If i
encounter a similar problem again, i just cut an paste the right snippets
rater than librarify it. I maybe make the wrong assumption that probably no
one is going to maintain my code after it has produced the intended
geometry.
--
Sent from: http://forum.openscad.org/
RP
Ronaldo Persiano
Sat, Dec 30, 2017 10:18 PM
Hi, Torleif.
We surely have different perspectives. I have some difficulties at
operational level (I have never been able to memorize the multiplication
table, for instance) and some skills at the conceptual level. So I usually
try to understand what is behind before seeing the front end. That is why I
use functions and modules a lot. Each one has a meaning and represent a
concept. And as they usually have fewer lines and key comments, I can
understand them months or years later. The same happens with code
formatting: I need a minimum of ruled format style to easily understand a
code.
I use that approach even for building an ad hoc code. Eventually I found
there something that may be reusable and worth to have in a library
although that is not my goal.
I rarely consider operator modules during the development phase. They
sometimes emerge later when I try to "wring" the code, a phase required by
some obsession.
If there is really such a discrimination, yes, I am more a software
programmer than a CAD programmer.
2017-12-30 18:53 GMT-02:00 TLC123 torleif.ceder@gmail.com:
Nice job Ro. I guess there is a bunch of ways to skin that cat.
I often find there is a difference between cad programming and software
programming in that there is less returned value in the effort to find very
general solutions to a loose set of problems. For me it's usually more
efficient to just find a simple solution to a specific problem. If i
encounter a similar problem again, i just cut an paste the right snippets
rater than librarify it. I maybe make the wrong assumption that probably no
one is going to maintain my code after it has produced the intended
geometry.
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Hi, Torleif.
We surely have different perspectives. I have some difficulties at
operational level (I have never been able to memorize the multiplication
table, for instance) and some skills at the conceptual level. So I usually
try to understand what is behind before seeing the front end. That is why I
use functions and modules a lot. Each one has a meaning and represent a
concept. And as they usually have fewer lines and key comments, I can
understand them months or years later. The same happens with code
formatting: I need a minimum of ruled format style to easily understand a
code.
I use that approach even for building an ad hoc code. Eventually I found
there something that may be reusable and worth to have in a library
although that is not my goal.
I rarely consider operator modules during the development phase. They
sometimes emerge later when I try to "wring" the code, a phase required by
some obsession.
If there is really such a discrimination, yes, I am more a software
programmer than a CAD programmer.
2017-12-30 18:53 GMT-02:00 TLC123 <torleif.ceder@gmail.com>:
> Nice job Ro. I guess there is a bunch of ways to skin that cat.
>
> I often find there is a difference between cad programming and software
> programming in that there is less returned value in the effort to find very
> general solutions to a loose set of problems. For me it's usually more
> efficient to just find a simple solution to a specific problem. If i
> encounter a similar problem again, i just cut an paste the right snippets
> rater than librarify it. I maybe make the wrong assumption that probably no
> one is going to maintain my code after it has produced the intended
> geometry.
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
C
Chocrates
Sun, Dec 31, 2017 4:17 PM
Awesome thank you guys. Still going through your solutions but they look
exactly like what I was trying to do.
Regarding CAD Programming vs General Programming, when you are building
geometry in CAD, do you ever expect to need to maintain it again to produce
a different iteration on your result?
I imagine if there is a piece of functionality that keeps getting copied and
pasted, that is when you make it in to a general solution in a library.
I was pointed to this one a while ago: https://github.com/jreinhardt/BOLTS,
but it doesn't look maintained so I wonder if people in general don't find
much value in cad libraries in general?
--
Sent from: http://forum.openscad.org/
Awesome thank you guys. Still going through your solutions but they look
exactly like what I was trying to do.
Regarding CAD Programming vs General Programming, when you are building
geometry in CAD, do you ever expect to need to maintain it again to produce
a different iteration on your result?
I imagine if there is a piece of functionality that keeps getting copied and
pasted, that is when you make it in to a general solution in a library.
I was pointed to this one a while ago: https://github.com/jreinhardt/BOLTS,
but it doesn't look maintained so I wonder if people in general don't find
much value in cad libraries in general?
--
Sent from: http://forum.openscad.org/
GW
G. Wade Johnson
Sun, Dec 31, 2017 5:17 PM
Awesome thank you guys. Still going through your solutions but they
look exactly like what I was trying to do.
Regarding CAD Programming vs General Programming, when you are
building geometry in CAD, do you ever expect to need to maintain it
again to produce a different iteration on your result?
I imagine if there is a piece of functionality that keeps getting
copied and pasted, that is when you make it in to a general solution
in a library. I was pointed to this one a while ago:
https://github.com/jreinhardt/BOLTS, but it doesn't look maintained
so I wonder if people in general don't find much value in cad
libraries in general?
I have my own libraries that I maintain in version control exactly like
I do any other code. I have used some libraries from others.
Honestly, I suspect that maintenance of cad libraries will follow the
same model as code libraries: some maintained, some not; some forked,
some not.
Remember that many people working with OpenSCAD are not programmers and
may not immediately think of libraries as a resource. Also OpenSCAD is
relatively new as languages go, this can result in many libraries
that scratch one person's itch but are not quite as re-usable or
simple as needed for others to use. Some language issues have also made
general libraries harder to make and maintain than we'd like.
These issues are improving, so keep an eye out.
G. Wade
--
Be careful about reading health books. You may die of a misprint.
-- Mark Twain
On Sun, 31 Dec 2017 09:17:46 -0700 (MST)
Chocrates <rougechampion2002@gmail.com> wrote:
> Awesome thank you guys. Still going through your solutions but they
> look exactly like what I was trying to do.
>
> Regarding CAD Programming vs General Programming, when you are
> building geometry in CAD, do you ever expect to need to maintain it
> again to produce a different iteration on your result?
> I imagine if there is a piece of functionality that keeps getting
> copied and pasted, that is when you make it in to a general solution
> in a library. I was pointed to this one a while ago:
> https://github.com/jreinhardt/BOLTS, but it doesn't look maintained
> so I wonder if people in general don't find much value in cad
> libraries in general?
I have my own libraries that I maintain in version control exactly like
I do any other code. I have used some libraries from others.
Honestly, I suspect that maintenance of cad libraries will follow the
same model as code libraries: some maintained, some not; some forked,
some not.
Remember that many people working with OpenSCAD are not programmers and
may not immediately think of libraries as a resource. Also OpenSCAD is
relatively new as languages go, this can result in many libraries
that scratch one person's itch but are not quite as re-usable or
simple as needed for others to use. Some language issues have also made
general libraries harder to make and maintain than we'd like.
These issues are improving, so keep an eye out.
G. Wade
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
--
Be careful about reading health books. You may die of a misprint.
-- Mark Twain
NH
nop head
Sun, Dec 31, 2017 5:20 PM
I use my own library in all but my simplest projects and find I need to
add to it for most projects. It is mainly models of non printed parts that
I use in assemblies but does have some utilities and some printed parts
that I use across projects such as boxes, feet, handles and fixing blocks.
I started it about a year ago. I include it in every printed part design
because at the very least it sets $fa and $fs for printing and defines
polyholes. These are the the larger things I have made with it over the
last year.
Cover and laser mount for HydraRaptor.
RPI LCD display case.
ATX lab PSU.
Mains PSU.
WiFi controlled photographic turntable.
Solder fume filter.
On 31 December 2017 at 16:17, Chocrates rougechampion2002@gmail.com wrote:
Awesome thank you guys. Still going through your solutions but they look
exactly like what I was trying to do.
Regarding CAD Programming vs General Programming, when you are building
geometry in CAD, do you ever expect to need to maintain it again to produce
a different iteration on your result?
I imagine if there is a piece of functionality that keeps getting copied
and
pasted, that is when you make it in to a general solution in a library.
I was pointed to this one a while ago: https://github.com/jreinhardt/BOLTS
,
but it doesn't look maintained so I wonder if people in general don't find
much value in cad libraries in general?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I use my own library in all but my simplest projects and find I need to
add to it for most projects. It is mainly models of non printed parts that
I use in assemblies but does have some utilities and some printed parts
that I use across projects such as boxes, feet, handles and fixing blocks.
I started it about a year ago. I include it in every printed part design
because at the very least it sets $fa and $fs for printing and defines
polyholes. These are the the larger things I have made with it over the
last year.
Cover and laser mount for HydraRaptor.
RPI LCD display case.
ATX lab PSU.
Mains PSU.
WiFi controlled photographic turntable.
Solder fume filter.
On 31 December 2017 at 16:17, Chocrates <rougechampion2002@gmail.com> wrote:
> Awesome thank you guys. Still going through your solutions but they look
> exactly like what I was trying to do.
>
> Regarding CAD Programming vs General Programming, when you are building
> geometry in CAD, do you ever expect to need to maintain it again to produce
> a different iteration on your result?
> I imagine if there is a piece of functionality that keeps getting copied
> and
> pasted, that is when you make it in to a general solution in a library.
> I was pointed to this one a while ago: https://github.com/jreinhardt/BOLTS
> ,
> but it doesn't look maintained so I wonder if people in general don't find
> much value in cad libraries in general?
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
DM
doug moen
Sun, Dec 31, 2017 5:32 PM
I have a lot of small library components that I continually reuse in other
projects.
CAD libraries can be useful, but there are a lot of factors involved:
- Is the library well designed and easy to use?
- Is the library robust, or does it fail on edge cases. This is related
to ease of use.
- Is the library well documented? An issue for using someone else's
library.
- How easy is it to install the library and start using it?
- How compelling is the library? Is it easier to write the code from
scratch than it
is to figure out how to install and use the library? An issue for
using someone
else's library.
Factors 1-3 are a job for the library designer. It's lot of work to make a
library useful to other people: you need well designed interfaces,
robustness, good documentation. About half of my "reusable code" can only
be reused by copying, pasting and hacking the code, since I haven't figured
out good general purpose APIs, or the code only works for a narrow range of
cases.
Factor 4 is a tool issue. In web programming, you can often start using a
3rd party javascript library just by pasting a URL into your web page,
which is super easy. In the Rust language, it's the same, if you use the
cargo tool: you can reference an external library using the URL of a git
repo. This means you can download somebody else's program and external
library dependencies are automatically taken care of, you don't need to
think about it. In OpenSCAD, it's not so easy.
On 31 December 2017 at 11:17, Chocrates rougechampion2002@gmail.com wrote:
Awesome thank you guys. Still going through your solutions but they look
exactly like what I was trying to do.
Regarding CAD Programming vs General Programming, when you are building
geometry in CAD, do you ever expect to need to maintain it again to produce
a different iteration on your result?
I imagine if there is a piece of functionality that keeps getting copied
and
pasted, that is when you make it in to a general solution in a library.
I was pointed to this one a while ago: https://github.com/jreinhardt/BOLTS
,
but it doesn't look maintained so I wonder if people in general don't find
much value in cad libraries in general?
--
Sent from: http://forum.openscad.org/
OpenSCAD mailing list
Discuss@lists.openscad.org
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
I have a lot of small library components that I continually reuse in other
projects.
CAD libraries can be useful, but there are a lot of factors involved:
1. Is the library well designed and easy to use?
2. Is the library robust, or does it fail on edge cases. This is related
to ease of use.
3. Is the library well documented? An issue for using someone else's
library.
4. How easy is it to install the library and start using it?
5. How compelling is the library? Is it easier to write the code from
scratch than it
is to figure out how to install and use the library? An issue for
using someone
else's library.
Factors 1-3 are a job for the library designer. It's lot of work to make a
library useful to other people: you need well designed interfaces,
robustness, good documentation. About half of my "reusable code" can only
be reused by copying, pasting and hacking the code, since I haven't figured
out good general purpose APIs, or the code only works for a narrow range of
cases.
Factor 4 is a tool issue. In web programming, you can often start using a
3rd party javascript library just by pasting a URL into your web page,
which is super easy. In the Rust language, it's the same, if you use the
cargo tool: you can reference an external library using the URL of a git
repo. This means you can download somebody else's program and external
library dependencies are automatically taken care of, you don't need to
think about it. In OpenSCAD, it's not so easy.
On 31 December 2017 at 11:17, Chocrates <rougechampion2002@gmail.com> wrote:
> Awesome thank you guys. Still going through your solutions but they look
> exactly like what I was trying to do.
>
> Regarding CAD Programming vs General Programming, when you are building
> geometry in CAD, do you ever expect to need to maintain it again to produce
> a different iteration on your result?
> I imagine if there is a piece of functionality that keeps getting copied
> and
> pasted, that is when you make it in to a general solution in a library.
> I was pointed to this one a while ago: https://github.com/jreinhardt/BOLTS
> ,
> but it doesn't look maintained so I wonder if people in general don't find
> much value in cad libraries in general?
>
>
>
>
> --
> Sent from: http://forum.openscad.org/
>
> _______________________________________________
> OpenSCAD mailing list
> Discuss@lists.openscad.org
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>
T
Troberg
Tue, Jan 2, 2018 8:37 AM
I often find there is a difference between cad programming and software
programming in that there is less returned value in the effort to find very
general solutions to a loose set of problems.
I don't agree, I find it extremely useful to have a good library of useful
generic code, both for convenience and for readability.
Unlike most here, I use OpenSCAD for making plans for builds, not for 3D
printing. So, I have a library with all the parts I use, screws, eyebolts,
threaded bars, nuts, washers, wooden parts, chains, hinges and so on. I also
have some useful math functions. There is also a bunch of useful operations,
such as modules to put a radius on a corner, drilling holes, making
transition curves and so on.
How does this help me?
-
I don't have to re-do each part.
-
If I make a better, more detailed model, it'll be replaced in every
design. Fix once, apply everywhere.
-
Sure, I could just to a difference with a cylinder to make a hole, but if
I make a difference with a hole object, it will clearly say "hole" in the
code. Likewise, a threaded bar is simply a cylinder if a certain diameter in
a certain color, but it makes for clearer code if it says threadedbar().
-
Since each object has it's own call, I get a part list. I know exactly how
many screws I need, how many meters of each type of wood I need and so on. I
get it with prices, where to buy it, product number, sometimes even which
shelf in the store, and even the weight of the parts.
-
Since each object and operation have it's own call, I also get an
"operations list". So, I know that I will have to measure and drill 300
holes, and that'll take approximataley so many minutes. I know that I'll
have to cut this many planks, and it'll take this long. If I want, I can
also add extra operations that aren't parts-based, or just because I know
that "rigging this up squarely will take some extra time...".
-
It helps me remember what resources I have. Often, I sit and think "how
will I solve this problem?", looking at the parts and suddenly "Hmm, if I
take a hinge and lock it with a slide bolt...".
-
It helps me keep a certain selection of standard parts. Nothing wrong with
having more different parts, but if there is no good reason for it, stick
with a part you have.
-
You can adapt the modules so that it's more handy to use. For example, my
screws and bits that goes on screws (nuts, washers, wingnuts...) all have a
z-offset and a parameter to flip them (where applicable). So, I create the
screw, then simply stack everything that goes on it using only the z-offset,
then move it in place. Example:
bolt_M10(3);
squarewasher_M10(0,false);
squarewasher_M10(45,true);
wingnut_M10(48,true);
This creates a bolt with a wingnut on the other end, and two square washers.
This can then be translated and rotated to wherever it's supposed to be.
Very simple and clear code.
--
Sent from: http://forum.openscad.org/
> I often find there is a difference between cad programming and software
programming in that there is less returned value in the effort to find very
general solutions to a loose set of problems.
I don't agree, I find it extremely useful to have a good library of useful
generic code, both for convenience and for readability.
Unlike most here, I use OpenSCAD for making plans for builds, not for 3D
printing. So, I have a library with all the parts I use, screws, eyebolts,
threaded bars, nuts, washers, wooden parts, chains, hinges and so on. I also
have some useful math functions. There is also a bunch of useful operations,
such as modules to put a radius on a corner, drilling holes, making
transition curves and so on.
How does this help me?
* I don't have to re-do each part.
* If I make a better, more detailed model, it'll be replaced in every
design. Fix once, apply everywhere.
* Sure, I could just to a difference with a cylinder to make a hole, but if
I make a difference with a hole object, it will clearly say "hole" in the
code. Likewise, a threaded bar is simply a cylinder if a certain diameter in
a certain color, but it makes for clearer code if it says threadedbar().
* Since each object has it's own call, I get a part list. I know exactly how
many screws I need, how many meters of each type of wood I need and so on. I
get it with prices, where to buy it, product number, sometimes even which
shelf in the store, and even the weight of the parts.
* Since each object and operation have it's own call, I also get an
"operations list". So, I know that I will have to measure and drill 300
holes, and that'll take approximataley so many minutes. I know that I'll
have to cut this many planks, and it'll take this long. If I want, I can
also add extra operations that aren't parts-based, or just because I know
that "rigging this up squarely will take some extra time...".
* It helps me remember what resources I have. Often, I sit and think "how
will I solve this problem?", looking at the parts and suddenly "Hmm, if I
take a hinge and lock it with a slide bolt...".
* It helps me keep a certain selection of standard parts. Nothing wrong with
having more different parts, but if there is no good reason for it, stick
with a part you have.
* You can adapt the modules so that it's more handy to use. For example, my
screws and bits that goes on screws (nuts, washers, wingnuts...) all have a
z-offset and a parameter to flip them (where applicable). So, I create the
screw, then simply stack everything that goes on it using only the z-offset,
then move it in place. Example:
bolt_M10(3);
squarewasher_M10(0,false);
squarewasher_M10(45,true);
wingnut_M10(48,true);
This creates a bolt with a wingnut on the other end, and two square washers.
This can then be translated and rotated to wherever it's supposed to be.
Very simple and clear code.
--
Sent from: http://forum.openscad.org/
T
TLC123
Tue, Jan 2, 2018 9:47 AM
I respect that OpenScad has a bunch of uses other than 3D printing.
For parts, i totally get it. Its a resource library in software analogy.
For functions its handy and i should probably maintain a basic library for
myself.
For modules as operators on unknown children i find it almost pointless to
package them up for general black box usage by others.
Sure it may function as shorthand sugar but as long as a module
cant know anything or reason about the children it cant provide
profound value for someone that don't understand the modules inner workings.
Point being, OpenScad scripts is not software, it's markup with the luxury
of evaluated expression.
I just belive it's somewhat important to note that distinction from time to
time.
Happy New Year to all of ya here.
--
Sent from: http://forum.openscad.org/
I respect that OpenScad has a bunch of uses other than 3D printing.
For parts, i totally get it. Its a resource library in software analogy.
For functions its handy and i should probably maintain a basic library for
myself.
For modules as operators on unknown children i find it almost pointless to
package them up for general black box usage by others.
Sure it may function as shorthand sugar but as long as a module
cant know anything or reason about the children it cant provide
profound value for someone that don't understand the modules inner workings.
Point being, OpenScad scripts is not software, it's markup with the luxury
of evaluated expression.
I just belive it's somewhat important to note that distinction from time to
time.
Happy New Year to all of ya here.
--
Sent from: http://forum.openscad.org/
T
Troberg
Tue, Jan 2, 2018 2:19 PM
That I agree with. I find it endlessly frustrating that I can't just do
something like:
sphere(d=100,name="thissphere");
and then later, after it's been moved around and all that do a:
translate([thissphere.x,thissphere.y,thissphere.z])
cylinder(d=thissphere.d,1000);
Or, stuff like my parts list. Since variables are kind of wonked compared to
other languages, I have to echo a line for each part, then copy the echo
output to another program I wrote which parses it and sums things up.
I've been thinking a lot about encapsulating the 3D markup in some framework
in some kind of "real script language", such as VBScript, JavaScript or
Rexx, but I haven't got around to actually doing anything.
--
Sent from: http://forum.openscad.org/
That I agree with. I find it endlessly frustrating that I can't just do
something like:
sphere(d=100,name="thissphere");
and then later, after it's been moved around and all that do a:
translate([thissphere.x,thissphere.y,thissphere.z])
cylinder(d=thissphere.d,1000);
Or, stuff like my parts list. Since variables are kind of wonked compared to
other languages, I have to echo a line for each part, then copy the echo
output to another program I wrote which parses it and sums things up.
I've been thinking a lot about encapsulating the 3D markup in some framework
in some kind of "real script language", such as VBScript, JavaScript or
Rexx, but I haven't got around to actually doing anything.
--
Sent from: http://forum.openscad.org/
CA
Carsten Arnholm
Tue, Jan 2, 2018 8:39 PM
On 02. jan. 2018 15:19, Troberg wrote:
That I agree with. I find it endlessly frustrating that I can't just do
something like:
sphere(d=100,name="thissphere");
and then later, after it's been moved around and all that do a:
translate([thissphere.x,thissphere.y,thissphere.z])
cylinder(d=thissphere.d,1000);
Or, stuff like my parts list. Since variables are kind of wonked compared to
other languages, I have to echo a line for each part, then copy the echo
output to another program I wrote which parses it and sums things up.
I've been thinking a lot about encapsulating the 3D markup in some framework
in some kind of "real script language", such as VBScript, JavaScript or
Rexx, but I haven't got around to actually doing anything.
I guess this is the recurring talk about the functional language in
OpenSCAD. The features you describe imply a procedural language. I have
had similar ideas regarding use of a scripting language. Your example
can be expressed as below using my AngelScript* implementation.
*AngelScript is a procedural language with strong types
http://www.angelcode.com/angelscript/sdk/docs/manual/doc_script.html
The @ notation refers to "object handles".
shape@ main_shape()
{
solid@ sph = translate(200,300,400)sphere(r:50);
sphere@ s = cast<sphere@>(sph);
pos3d@ c = s.box().center();
return translate(c.x(),c.y(),c.z())
cylinder(r:s.radius(),h:1000) + s;
}
It may be possible to eliminate the second line to make it more compact,
but this runs as shown now creating an explicit union of a cylinder and
the given sphere 's', much like you explained.
The attached OpenSCAD file was generated from the above script.
Carsten Arnholm
On 02. jan. 2018 15:19, Troberg wrote:
> That I agree with. I find it endlessly frustrating that I can't just do
> something like:
>
> sphere(d=100,name="thissphere");
>
> and then later, after it's been moved around and all that do a:
>
> translate([thissphere.x,thissphere.y,thissphere.z])
> cylinder(d=thissphere.d,1000);
>
> Or, stuff like my parts list. Since variables are kind of wonked compared to
> other languages, I have to echo a line for each part, then copy the echo
> output to another program I wrote which parses it and sums things up.
>
> I've been thinking a lot about encapsulating the 3D markup in some framework
> in some kind of "real script language", such as VBScript, JavaScript or
> Rexx, but I haven't got around to actually doing anything.
I guess this is the recurring talk about the functional language in
OpenSCAD. The features you describe imply a procedural language. I have
had similar ideas regarding use of a scripting language. Your example
can be expressed as below using my AngelScript* implementation.
*AngelScript is a procedural language with strong types
http://www.angelcode.com/angelscript/sdk/docs/manual/doc_script.html
The @ notation refers to "object handles".
shape@ main_shape()
{
solid@ sph = translate(200,300,400)*sphere(r:50);
sphere@ s = cast<sphere@>(sph);
pos3d@ c = s.box().center();
return translate(c.x(),c.y(),c.z())*
cylinder(r:s.radius(),h:1000) + s;
}
It may be possible to eliminate the second line to make it more compact,
but this runs as shown now creating an explicit union of a cylinder and
the given sphere 's', much like you explained.
The attached OpenSCAD file was generated from the above script.
Carsten Arnholm