Polyhedron tube with irregular sides -- is it possible ?

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

Re: Polyhedron tube with irregular sides -- is it possible ?

NateTG
cacb wrote
> ...
> Why this long and complex discussion when you can use 2D booleans - i.e.
> subtract the holes from the main rectangle and simply extrude that?
>
> What is missing in this thinking?
> ...

I wanted to do 'wrap text on surface' stuff.  To make that work involves a
plastic transform, which, in OPENscad is only possible if you manipulate the
points as data.

https://gist.github.com/NateTG/b350378c56f436d3996a2107f7cba965



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron tube with irregular sides -- is it possible ?

NateTG
In reply to this post by Ronaldo
Ronaldo wrote
> I agree that earcut method may generate very bad triangles, almost
> degenerated. That is one reason I would look for something else. I don't
> know how the sweep line algorithms work but remind that for our
> application
> in mind we can't add new vertices to any polygonal.

You don't have to add vertices.  If you're sweeping "left to right" then it
will cut at every vertex that is "convex to the right."

It's basically this:

https://en.wikipedia.org/wiki/Polygon_triangulation#Monotone_Polygon_Triangulation



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron tube with irregular sides -- is it possible ?

cacb
In reply to this post by Ronaldo
On 2019-01-21 21:59, Ronaldo Persiano wrote:
> <[hidden email]> wrote:
>
>> Why this long and complex discussion when you can use 2D booleans -
>> i.e.
>> subtract the holes from the main rectangle and simply extrude that?
>
> The main goal now is to sweep a polygon with holes along a polygonal
> line using fast polyhedron.

Maybe achieving something similar to this then?
https://gist.github.com/arnholm/931bba4633ca344a3ffe0698b945395f

> This avoid slower boolean operations. As
> Parkinbot pointed before, we might instead sweep the polygon border
> and subtract the sweeping of each hole in a slower process.

Ok, but this should not really take a lot of processing time with any of
the possible approaches. The example above, which take a "high level
approach" instead of constructing a complex polyhedron manually, was
processed with https://github.com/arnholm/xcsg in less than 0.15 sec.

The 2d booleans are not slow in OpenSCAD, a built-in sweep is missing
though.

Carsten Arnholm




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron tube with irregular sides -- is it possible ?

Parkinbot
Carsten,

being able to extrude a 2D object (with holes) along a fancy path in
extension of linear_extrude would be a nice to have (without having to
install angelscript :-) ), but the discussed approach is even more
ambitious. Just read the thread from start.

The multi hole sweep will allow each polygon to morph along the path, like
shown in the following example code that "extrudes" a CW screw with a CCW
hole:

<http://forum.openscad.org/file/t887/CWCCW.png>

use <Naca_sweep.scad>
difference()
{
  sweep(gendat(circle(100, N=4), 1));
  sweep(gendat(circle(60, N=4), -.5));
}

function gendat(P, dir=1) =
[for (i=[-45:45]) Tz_(i, Rz_(dir*i, vec3D(P)))];

function circle(r, N) = [for(i=[0:N-1]) let(w=-360/N*i) r*[cos(w), sin(w)]];



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron tube with irregular sides -- is it possible ?

cacb
On 2019-01-22 13:36, Parkinbot wrote:
> Carsten,
>
> being able to extrude a 2D object (with holes) along a fancy path in
> extension of linear_extrude would be a nice to have (without having to
> install angelscript :-) ),

You don't need angelscript to do it. The xcsg application knows nothing
about angelscript, it only relates to the specification of the wiki at
https://github.com/arnholm/xcsg/wiki . In theory, OpenSCAD could be an
alternative front end.

> but the discussed approach is even more
> ambitious. Just read the thread from start.
> The multi hole sweep will allow each polygon to morph along the path,
> like
> shown in the following example code that "extrudes" a CW screw with a
> CCW
> hole:
> <http://forum.openscad.org/file/t887/CWCCW.png>

Ok, that was the part I was missing then, thanks. I agree that is more
ambitious.

Talking about morphing, I have tried that (with holes also)
https://github.com/arnholm/xcsg/wiki/transform_extrude , but not in
combination with a general sweep path.

Carsten Arnholm





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|

Re: Polyhedron tube with irregular sides -- is it possible ?

Parkinbot
cacb wrote
> You don't need angelscript to do it. The xcsg application knows nothing
> about angelscript, it only relates to the specification of the wiki at
> https://github.com/arnholm/xcsg/wiki . In theory, OpenSCAD could be an
> alternative front end.

thanks for the hint. I always wanted to find out how to use MATLAB as a
frontend. Hope I'll soon find time to dig deeper into this interesting
approach.  


cacb wrote
> Talking about morphing,

OK, this is a trivial linear interpolation and more or less a one-liner, if
you have arithmetics operating over point lists.



--
Sent from: http://forum.openscad.org/

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
12345