making vases, perhaps with InkScape

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

Re: making vases, perhaps with InkScape

Gadgetmind
On 18/02/18 23:10, Revar Desmera wrote:
Sadly, CGAL will barf frequently even with known good coplanar face points. CGAL is only really reliable with triangles, in my experience. 

I discovered this when using the skin () module from list-comprehensions, as the top and bottom of the shape aren't triangulated and can cause cgal errors, so I added the option to do this. I ended up leaving the option enabled the whole time.

Unfortunately I've done some other hacking around so I don't think this code will drop straight in. (BTW, RangeToVec could maybe be done with new "each" function.)

    function cap(start, end, order) = [for (p = [start+1:end-1]) [start, p+order, p+(1-order)]]; // Order = 0 ascending, 1 descending
 
    triangles = [
        for(index = [1:N-1])
            for(t = profile_triangles(index))
                t
    ];
 
    start_cap = npstart == true ? cap(start=0, end=P-1, order=0) : [RangeToVec([0:P-1])];
    end_cap   = npend == true ? cap (start=P*(N-1), end=P*N-1, order=1) : [RangeToVec([P*N-1 : -1 : P*(N-1)])];
 
    polyhedron(convexity=2, points=profiles, faces=concat(start_cap, triangles, end_cap));



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

Re: making vases, perhaps with InkScape

NateTG
In reply to this post by NateTG
If anyone cares, this version checks for the 'last ear' problem and handles
it.

triangulate.scad <http://forum.openscad.org/file/t2140/triangulate.scad>  



--
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: making vases, perhaps with InkScape

Gadgetmind
On 21/02/18 23:59, NateTG wrote:
If anyone cares, this version checks for the 'last ear' problem and handles
it.

triangulate.scad <http://forum.openscad.org/file/t2140/triangulate.scad>  

I definitely care because skin () doesn't triangulate the end caps of the object. I added triangulation that will handle convex shapes only and may see how to build your function into it instead.

Perhaps polyhedron () should have an option to triangulate any face that has >3 vertices? I'd much prefer that this be in the guts of OpenSCAD rather than in "user land".

Hmmm, how does this work for polygons? I don't recall seeing issues with complex extruded polygons due to >3 vertex faces causing cgal mayhem.




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

Re: making vases, perhaps with InkScape

nophead
Polyhedron does triangulate faces with more than three sides. It gives a warning first though and a few recent versions have a bug that makes it an error.

On 22 Feb 2018 8:58 a.m., "Gadgetmind" <[hidden email]> wrote:
On 21/02/18 23:59, NateTG wrote:
If anyone cares, this version checks for the 'last ear' problem and handles
it.

triangulate.scad <http://forum.openscad.org/file/t2140/triangulate.scad>  

I definitely care because skin () doesn't triangulate the end caps of the object. I added triangulation that will handle convex shapes only and may see how to build your function into it instead.

Perhaps polyhedron () should have an option to triangulate any face that has >3 vertices? I'd much prefer that this be in the guts of OpenSCAD rather than in "user land".

Hmmm, how does this work for polygons? I don't recall seeing issues with complex extruded polygons due to >3 vertex faces causing cgal mayhem.




_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.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: making vases, perhaps with InkScape

Gadgetmind
On 22/02/18 10:08, nop head wrote:
Polyhedron does triangulate faces with more than three sides. It gives a warning first though and a few recent versions have a bug that makes it an error.

Ah, OK. I've seen the retry warning due to non-planar but, as you say, it's usually followed by an error. Has the bug been fixed?

Might being able to force the triangulation save rendering time?





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

Re: making vases, perhaps with InkScape

Ronaldo

Ah, OK. I've seen the retry warning due to non-planar but, as you say, it's usually followed by an error. Has the bug been fixed?

Might being able to force the triangulation save rendering time?

Yes, the bug was fixed in the last snapshot and a triangulation in user space isn't necessary. Besides, I have observed in some older versions that CGAL changed the triangulation I had prescribed. 

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

Re: making vases, perhaps with InkScape

NateTG
In reply to this post by Gadgetmind
Gadgetmind wrote
> Might being able to force the triangulation save rendering time?
>
> ...

I'm not sure you can force a particular triangulation since CGAL does its
own thing.

My triangulator is also very slow and may misbehave unpredictably with bad
input.  If the native OpenSCAD version works for you, I would recommend
using that.


Gadgetmind wrote
> ...
>  I'd much prefer that this be in the guts of OpenSCAD rather than in "user
> land".
> ...

Native solutions are typically better, but there's something to be said for
being able to solve stuff in "user land" so that people aren't so reliant on
the OpenSCAD devs.





--
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: making vases, perhaps with InkScape

Gadgetmind
On 22/02/18 14:28, NateTG wrote:
> I'm not sure you can force a particular triangulation since CGAL does its
> own thing.

The logic seems to be there but only used if/when cgal eventually barfs.
If I know it'll barf, then why not provide this information?

> Native solutions are typically better, but there's something to be said for
> being able to solve stuff in "user land" so that people aren't so reliant on
> the OpenSCAD devs.

Agreed, and I currently triangulate myself, but with a solution that
only work for concave.

Maybe I'll open a feature request. And perhaps also suggest some code ...

Ian



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

Re: making vases, perhaps with InkScape

kintel
Administrator
In reply to this post by Gadgetmind
> On Feb 22, 2018, at 7:30 AM, Gadgetmind <[hidden email]> wrote:
>
> On 22/02/18 10:08, nop head wrote:
>> Polyhedron does triangulate faces with more than three sides. It gives a warning first though and a few recent versions have a bug that makes it an error.
> Ah, OK. I've seen the retry warning due to non-planar but, as you say, it's usually followed by an error. Has the bug been fixed?
>
I don’t think I’m aware of this bug. Has this been reported on the github issue tracker?

 -Marius


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

Re: making vases, perhaps with InkScape

Ronaldo
I guess Parkinbot refers to the issue  #2246. See: http://forum.openscad.org/Alternate-triangulation-bug-td22938.html


2018-02-23 23:44 GMT-03:00 Marius Kintel <[hidden email]>:
> On Feb 22, 2018, at 7:30 AM, Gadgetmind <[hidden email]> wrote:
>
> On 22/02/18 10:08, nop head wrote:
>> Polyhedron does triangulate faces with more than three sides. It gives a warning first though and a few recent versions have a bug that makes it an error.
> Ah, OK. I've seen the retry warning due to non-planar but, as you say, it's usually followed by an error. Has the bug been fixed?
>
I don’t think I’m aware of this bug. Has this been reported on the github issue tracker?

 -Marius


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


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