Added loop() and loop_extrude() to openSCAD

classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

Added loop() and loop_extrude() to openSCAD

devlaam
Two new primitives are introduced in my fork of openSCAD.
It is downloadable from:

  https://github.com/devlaam/openscad.git

and i hereby invite the original authors of openSCAD to
try it out and possibly integrate the functionality into
the master branch.

The primitives are:
  loop()
  loop_extrude()

The first, loop() is meant to draw 2D closed curves and
with loop_extrude() it is possible to extrude any closed
curve along a the closed trajectory in 3D space. For the
use, see:

  https://github.com/devlaam/openscad/blob/loop_extension/doc/Loop.pdf

One example attached.

Please note that the code is 'alpha' at the moment. This
is because no (rigorous) testing has been written yet so the
code may leak memory, crash or otherwise produce erroneous
results. The examples treated in the document however should
work. I intend to clean up code, and fix bugs in the
weeks to come, should there be this desire.

Have Fun!

Ruud

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

front3.jpg (60K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

kintel
Administrator
Wow,

Thanks for a very comprehensive feature documentation!
Once the current release is out the door, I'll look into this.
I cannot promise how fast this would be though, as I may need some time off, but I'll do my best to take a look at it, and facilitate further development/integration.

Cheers,

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

devlaam
On 05-06-13 21:03, Marius Kintel wrote:
 > I cannot promise how fast this would be though, as I may
 > need some time off, but I'll do my best to take a look
 > at it, and facilitate further development/integration.

Take your time! I am already surprised that you
hang out here all the time and still get some work
done!

@Others: please give my features a try and let me
know what your experiences are. The code does not
have many 'burn' hours yet, so some peculiarities
may arise. I already detected some smaller bugs.

At least it provides some of the possibilities a
lot of people have been asking about. For example:

- easy way to define a polygon, you can specify
   the size of the size, inner or outer circle.

- rounded corners

- bezier forms

- extrusion along a 3D path

Ruud
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

Felipe Sanches
Can the 3d path be open-ended? Or is it restricted to loops ?

On Wed, Jun 5, 2013 at 4:36 PM, Ruud Vlaming <[hidden email]> wrote:

> On 05-06-13 21:03, Marius Kintel wrote:
>  > I cannot promise how fast this would be though, as I may
>  > need some time off, but I'll do my best to take a look
>  > at it, and facilitate further development/integration.
>
> Take your time! I am already surprised that you
> hang out here all the time and still get some work
> done!
>
> @Others: please give my features a try and let me
> know what your experiences are. The code does not
> have many 'burn' hours yet, so some peculiarities
> may arise. I already detected some smaller bugs.
>
> At least it provides some of the possibilities a
> lot of people have been asking about. For example:
>
> - easy way to define a polygon, you can specify
>    the size of the size, inner or outer circle.
>
> - rounded corners
>
> - bezier forms
>
> - extrusion along a 3D path
>
> Ruud
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

Kenneth Sloan
In reply to this post by devlaam


2 questions:

a) does the cross-section remain fixed in orientation?

b) is the restriction to "closed curve" necessary?


For a), this may create problems if the curve travels in the plane of the cross-section.  Alas, there
may be no EASY way to get this right.

For b), my preference would be a parameter ("closed=true/FALSE")

--
Kenneth Sloan
[hidden email]


On Jun 5, 2013, at 09:25 , Ruud Vlaming <[hidden email]> wrote:

> Two new primitives are introduced in my fork of openSCAD.
> It is downloadable from:
>
>  https://github.com/devlaam/openscad.git
>
> and i hereby invite the original authors of openSCAD to
> try it out and possibly integrate the functionality into
> the master branch.
>
> The primitives are:
>  loop()
>  loop_extrude()
>
> The first, loop() is meant to draw 2D closed curves and
> with loop_extrude() it is possible to extrude any closed
> curve along a the closed trajectory in 3D space. For the
> use, see:
>
>  https://github.com/devlaam/openscad/blob/loop_extension/doc/Loop.pdf
>
> One example attached.
>
> Please note that the code is 'alpha' at the moment. This
> is because no (rigorous) testing has been written yet so the
> code may leak memory, crash or otherwise produce erroneous
> results. The examples treated in the document however should
> work. I intend to clean up code, and fix bugs in the
> weeks to come, should there be this desire.
>
> Have Fun!
>
> Ruud
> <front3.jpg>_______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

devlaam
In reply to this post by Felipe Sanches
On 05-06-13 21:43, Felipe Sanches wrote:
> Can the 3d path be open-ended? Or is it restricted to loops ?
It is restricted to loops, but that is not a problem, since
you may hide any segment of the loop from the view. So
if you hide the last segment(s) you may effectively
conceal it is a loop.

Moreover, the hidden segments do not have to be
adjacent, so other partial structures are possible
too. See example.

Ruud

>
> On Wed, Jun 5, 2013 at 4:36 PM, Ruud Vlaming <[hidden email]> wrote:
>> On 05-06-13 21:03, Marius Kintel wrote:
>>   > I cannot promise how fast this would be though, as I may
>>   > need some time off, but I'll do my best to take a look
>>   > at it, and facilitate further development/integration.
>>
>> Take your time! I am already surprised that you
>> hang out here all the time and still get some work
>> done!
>>
>> @Others: please give my features a try and let me
>> know what your experiences are. The code does not
>> have many 'burn' hours yet, so some peculiarities
>> may arise. I already detected some smaller bugs.
>>
>> At least it provides some of the possibilities a
>> lot of people have been asking about. For example:
>>
>> - easy way to define a polygon, you can specify
>>     the size of the size, inner or outer circle.
>>
>> - rounded corners
>>
>> - bezier forms
>>
>> - extrusion along a 3D path
>>
>> Ruud
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://rocklinux.net/mailman/listinfo/openscad
>> http://openscad.org - https://flattr.com/thing/121566
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

hiding.png (46K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

kintel
Administrator
Off-topic, but:

Ruud, I see that you're hit by the "black shading bug". This appears to happen on some Macbook computers, depending on the GPU.
I've never managed to reproduce it on my machines, but then again, I've never had an Intel GPU.

Any insights would be helpful :)
See https://github.com/openscad/openscad/issues/71

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

devlaam
In reply to this post by Kenneth Sloan
On 05-06-13 21:54, Kenneth Sloan wrote:
> a) does the cross-section remain fixed in orientation?
No necessarily. It rotates along the curve following
a frame that minimizes torsion. You may alter the
scale and orientation of the extruded object
along that frame, but this can be tricky. If you
are not careful, you introduce a lot of torsion,
that is all unwind in the last segment. That
can give pretty bizarre images.

> b) is the restriction to "closed curve" necessary?
Yes and no. The curve must be closed, but does not
need to be completely visible. See previous post,
with example image.

> For a), this may create problems if the curve travels in
 > the plane of the cross-section.  Alas, there
> may be no EASY way to get this right.
Correct, is some situations there is not even a
HARD way out, There is simply no (continuous
differentiable) way. However, there may be
way out with cheating, but i have not implemented
this yet. (See the trefoil image i posted with
the original post)

> For b), my preference would be a parameter ("closed=true/FALSE")
This was my first implementation too, but later i changed
it to "hide" that can be toggled per segment. Gives much
more flexibility :)

Ruud

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

Kenneth Sloan
Very nice.  

I would love to be able to promise to test - but I'm swamped.  When this
becomes part of the standard distribution, I will certainly be a user.

[I'll still be rolling-my-own in Java to tackle the trickier issues - but I will
find lots of uses for this.]

Thanks, very much!

[Ruud - will you be in Bournemouth for SMI2013?]

--
Kenneth Sloan
[hidden email]


On Jun 5, 2013, at 13:12 , Ruud Vlaming <[hidden email]> wrote:

> On 05-06-13 21:54, Kenneth Sloan wrote:
>> a) does the cross-section remain fixed in orientation?
> No necessarily. It rotates along the curve following
> a frame that minimizes torsion. You may alter the
> scale and orientation of the extruded object
> along that frame, but this can be tricky. If you
> are not careful, you introduce a lot of torsion,
> that is all unwind in the last segment. That
> can give pretty bizarre images.
>
>> b) is the restriction to "closed curve" necessary?
> Yes and no. The curve must be closed, but does not
> need to be completely visible. See previous post,
> with example image.
>
>> For a), this may create problems if the curve travels in
>> the plane of the cross-section.  Alas, there
>> may be no EASY way to get this right.
> Correct, is some situations there is not even a
> HARD way out, There is simply no (continuous
> differentiable) way. However, there may be
> way out with cheating, but i have not implemented
> this yet. (See the trefoil image i posted with
> the original post)
>
>> For b), my preference would be a parameter ("closed=true/FALSE")
> This was my first implementation too, but later i changed
> it to "hide" that can be toggled per segment. Gives much
> more flexibility :)
>
> Ruud
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

devlaam
In reply to this post by devlaam
Just to answer my own post. I have fixed two bugs:

  - outer vertex plane could be rendered incorrectly in some
    cases due to a forgotten minus sign .
  - very first extruded plane was not rotated correctly due
    to incorrect plane numbering.

and made the error handling more like a good openSCAD
citizen; warnings are now emitted in the message
pane instead of the console.

I know the code can be optimized and refactored quite
a bit, but before i start making a project on its
own out of this, i would be happy to know what is
going to happen.

If anyone needs a binary exe to test, just let me know.

Ruud




On 05-06-13 18:25, Ruud Vlaming wrote:

> Two new primitives are introduced in my fork of openSCAD.
> It is downloadable from:
>
>    https://github.com/devlaam/openscad.git
>
> and i hereby invite the original authors of openSCAD to
> try it out and possibly integrate the functionality into
> the master branch.
>
> The primitives are:
>    loop()
>    loop_extrude()
>
> The first, loop() is meant to draw 2D closed curves and
> with loop_extrude() it is possible to extrude any closed
> curve along a the closed trajectory in 3D space. For the
> use, see:
>
>    https://github.com/devlaam/openscad/blob/loop_extension/doc/Loop.pdf
>
> One example attached.
>
> Please note that the code is 'alpha' at the moment. This
> is because no (rigorous) testing has been written yet so the
> code may leak memory, crash or otherwise produce erroneous
> results. The examples treated in the document however should
> work. I intend to clean up code, and fix bugs in the
> weeks to come, should there be this desire.
>
> Have Fun!
>
> Ruud
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

devlaam
In reply to this post by kintel
Yes, i first thought it was 'a feature', i mean, that there was simply
no moon implemented. But it turns out to be a bug. Is this something
where i can be of assistance? I have no clue where to look right now.

Ruud.

On 05-06-13 22:07, Marius Kintel wrote:

> Off-topic, but:
>
> Ruud, I see that you're hit by the "black shading bug". This appears to happen on some Macbook computers, depending on the GPU.
> I've never managed to reproduce it on my machines, but then again, I've never had an Intel GPU.
>
> Any insights would be helpful :)
> See https://github.com/openscad/openscad/issues/71
>
>   -Marius
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

kintel
Administrator
On 2013-06-07, at 11:07 , Ruud Vlaming wrote:

> Yes, i first thought it was 'a feature', i mean, that there was simply
> no moon implemented. But it turns out to be a bug. Is this something
> where i can be of assistance? I have no clue where to look right now.
>
I'm uncertain where to start. I remember there being report of a similar bug in other software (thingiview I think), so the best right now would be try to look for patterns. If other software had the bug and fixed it, we could look at the patches :)

..but ultimately I'd like to see the entire rendering code rewritten in modern opengl (or using a library)

 -Marius

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Ivo
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

Ivo
In reply to this post by devlaam
Thanks Ruud,

This is just what i was looking for. The documentation and examples look very nice as well.

I think it's time for me to start building openscad from source so i can get to use this and the svg import.

It would be nice if the poly primitive type you introduce could somehow become a first class openscad type. That way imported arcs, splines and circles from dxf and svg would not have to be stroked om import (i'm assuming they are now) and stroking could be delayed until rendering.

Ivo
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

devlaam
Thank you for the compliments Ivo!

A have recently extended the possibilities a little, but please
understand this is work in progress. See github.

Examples generated with :

loop(poly=[40,"rout","flat",[5,5,4,4]]);

and :

$fn=50;
loop_extrude(
   points=["cylinder",[0,0,0],
     [8,0,0],[8,90,1],[8,180,2],[8,270,3],
     [8,0,4],[8,90,5],[8,180,6],[8,270,7],
     [8,0,8],[8,90,9],[8,180,10],[8,270,11],
     [8,0,12],[0,0,12]],
   vertices=[["arc",5.65],1,15,["arc",2.3]]) circle(1);

Have Fun!
Ruud.



On 14-06-13 08:34, Ivo wrote:

> Thanks Ruud,
>
> This is just what i was looking for. The documentation and examples look
> very nice as well.
>
> I think it's time for me to start building openscad from source so i can get
> to use this and the svg import.
>
> It would be nice if the poly primitive type you introduce could somehow
> become a first class openscad type. That way imported arcs, splines and
> circles from dxf and svg would not have to be stroked om import (i'm
> assuming they are now) and stroking could be delayed until rendering.
>
> Ivo
>
>
>
> --
> View this message in context: http://forum.openscad.org/Added-loop-and-loop-extrude-to-openSCAD-tp4644p4754.html
> Sent from the OpenSCAD mailing list archive at Nabble.com.
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://rocklinux.net/mailman/listinfo/openscad
> http://openscad.org - https://flattr.com/thing/121566
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566

first.png (21K) Download Attachment
second.jpg (50K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

Dan Kirshner
In reply to this post by devlaam
Ruud,

I love what you've done here -- the vector manipulation capabilities alone are very valuable!

I find the Windows installation instructions in the OpenScad manual, however, to be daunting -- I think it would take me a week to go through all that!

Do you know of anyone who has a Windows executable they could share?

Thanks much!

--Dan
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

devlaam
On 01/02/14 19:23, Dan Kirshner wrote:
> I love what you've done here -- the vector manipulation capabilities alone
> are very valuable!

Thanks a lot for the compliments!


> I find the Windows installation instructions in the OpenScad manual,
> however, to be daunting -- I think it would take me a week to go through all
> that!
 > Do you know of anyone who has a Windows executable they could share?

I hope some on this forum reacts. Unfortunately i have no
experience with building OpenScad under the windows. But since
building my extension is no different than building the standard
version (apart from the fact the you must pay some attention
if you need the mlib) i think that anyone with OpenScad build
experience on Windows should be able to assist you.

Ruud


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566
Reply | Threaded
Open this post in threaded view
|

Re: Added loop() and loop_extrude() to openSCAD

donbright
You might also start a bounty on bountysource for experimental windows binaries.


On Sun, Feb 2, 2014 at 3:28 AM, Ruud Vlaming <[hidden email]> wrote:
On 01/02/14 19:23, Dan Kirshner wrote:
> I love what you've done here -- the vector manipulation capabilities alone
> are very valuable!

Thanks a lot for the compliments!


> I find the Windows installation instructions in the OpenScad manual,
> however, to be daunting -- I think it would take me a week to go through all
> that!
 > Do you know of anyone who has a Windows executable they could share?

I hope some on this forum reacts. Unfortunately i have no
experience with building OpenScad under the windows. But since
building my extension is no different than building the standard
version (apart from the fact the you must pay some attention
if you need the mlib) i think that anyone with OpenScad build
experience on Windows should be able to assist you.

Ruud


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://rocklinux.net/mailman/listinfo/openscad
http://openscad.org - https://flattr.com/thing/121566