Is Clipper as opaque as CGAL?

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

Is Clipper as opaque as CGAL?

boxcarmib
I know that there’s effectively no access to CGAL during interpretation, and that the dream of being able to poll for dimensions after transformation is going to remain a dream, but is the same true for Clipper?
I have been developing an increasing list of modules and functions that manipulate arrays of points and finding that very helpful for many modelling projects.
It would be fantastic if there was access to clipper’s 2D boolean functions like Union, Difference, Intersection etc… so my question is with regard to the availability of clipper functions in an OpenSCAD program. It it like CGAL and it’s just a closed box, or is it possible that OpenSCAD functions could be made available that performed 2D boolean operations on point lists?
I’m sure this has been asked before, but I did do some research and didn’t come up with any history on this matter, so I do apologize if this has been answered a thousand times before. I appreciate that the power of such functionality is so appealing that if it could be done it would have been done already, but I thought I’d ask.


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

Re: Is Clipper as opaque as CGAL?

RevarBat
About 3 months ago I submitted PR#3288 to OpenSCAD to provide full access to ClipperLib Boolean geometry. I’m still waiting to see if it will be accepted and merged. 


In the meantime, if you really need it, I’ve implemented 2D Boolean geometry in the BOSL2 library. It not yet a complete library yet, but if you really need it, the code is there. 


-Revar


On Jul 28, 2020, at 4:24 PM, Hugo Jackson <[hidden email]> wrote:

I know that there’s effectively no access to CGAL during interpretation, and that the dream of being able to poll for dimensions after transformation is going to remain a dream, but is the same true for Clipper?
I have been developing an increasing list of modules and functions that manipulate arrays of points and finding that very helpful for many modelling projects.
It would be fantastic if there was access to clipper’s 2D boolean functions like Union, Difference, Intersection etc… so my question is with regard to the availability of clipper functions in an OpenSCAD program. It it like CGAL and it’s just a closed box, or is it possible that OpenSCAD functions could be made available that performed 2D boolean operations on point lists?
I’m sure this has been asked before, but I did do some research and didn’t come up with any history on this matter, so I do apologize if this has been answered a thousand times before. I appreciate that the power of such functionality is so appealing that if it could be done it would have been done already, but I thought I’d ask.


_______________________________________________
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: Is Clipper as opaque as CGAL?

nophead
CGAL isn't a closed box, it is just very very slow. The main reason you don't get access to geometry is it isn't evaluated with CGAL during a preview when OpenCSG is used to make pictures of it.

On Wed, 29 Jul 2020 at 01:03, Revar Desmera <[hidden email]> wrote:
About 3 months ago I submitted PR#3288 to OpenSCAD to provide full access to ClipperLib Boolean geometry. I’m still waiting to see if it will be accepted and merged. 


In the meantime, if you really need it, I’ve implemented 2D Boolean geometry in the BOSL2 library. It not yet a complete library yet, but if you really need it, the code is there. 


-Revar


On Jul 28, 2020, at 4:24 PM, Hugo Jackson <[hidden email]> wrote:

I know that there’s effectively no access to CGAL during interpretation, and that the dream of being able to poll for dimensions after transformation is going to remain a dream, but is the same true for Clipper?
I have been developing an increasing list of modules and functions that manipulate arrays of points and finding that very helpful for many modelling projects.
It would be fantastic if there was access to clipper’s 2D boolean functions like Union, Difference, Intersection etc… so my question is with regard to the availability of clipper functions in an OpenSCAD program. It it like CGAL and it’s just a closed box, or is it possible that OpenSCAD functions could be made available that performed 2D boolean operations on point lists?
I’m sure this has been asked before, but I did do some research and didn’t come up with any history on this matter, so I do apologize if this has been answered a thousand times before. I appreciate that the power of such functionality is so appealing that if it could be done it would have been done already, but I thought I’d ask.


_______________________________________________
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

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

Re: Is Clipper as opaque as CGAL?

boxcarmib
In reply to this post by RevarBat
Hey, thanks for this… I hope it gets incorporated into the official relase!

On Jul 28, 2020, at 5:02 PM, Revar Desmera <[hidden email]> wrote:

About 3 months ago I submitted PR#3288 to OpenSCAD to provide full access to ClipperLib Boolean geometry. I’m still waiting to see if it will be accepted and merged. 


In the meantime, if you really need it, I’ve implemented 2D Boolean geometry in the BOSL2 library. It not yet a complete library yet, but if you really need it, the code is there. 


-Revar


On Jul 28, 2020, at 4:24 PM, Hugo Jackson <[hidden email]> wrote:

I know that there’s effectively no access to CGAL during interpretation, and that the dream of being able to poll for dimensions after transformation is going to remain a dream, but is the same true for Clipper?
I have been developing an increasing list of modules and functions that manipulate arrays of points and finding that very helpful for many modelling projects.
It would be fantastic if there was access to clipper’s 2D boolean functions like Union, Difference, Intersection etc… so my question is with regard to the availability of clipper functions in an OpenSCAD program. It it like CGAL and it’s just a closed box, or is it possible that OpenSCAD functions could be made available that performed 2D boolean operations on point lists?
I’m sure this has been asked before, but I did do some research and didn’t come up with any history on this matter, so I do apologize if this has been answered a thousand times before. I appreciate that the power of such functionality is so appealing that if it could be done it would have been done already, but I thought I’d ask.


_______________________________________________
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


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

Re: Is Clipper as opaque as CGAL?

boxcarmib
In reply to this post by nophead
I confess I don’t really know enough to even be asking intelligent questions… but I would submit that speed is not a primary concern if one has access to a functionality that can do something that would be extremely difficult to do otherwise. By way of comparison, I would suggest minkowski… which depending on its application adds signficant processing times for a render… on the other hand, I presume that for some users, that functionality is worth the wait… regardless of how long it takes.
Anyway, I appreciate that I”m probably mixing ‘problems’… in that boolean operations are a different animal than my dream of being able to get the boundaries of an object after an operation is performed rather than having to calculate what it will be independent of the actual operation.
Regardless… OpenSCAD is great!

On Jul 29, 2020, at 12:37 AM, nop head <[hidden email]> wrote:

CGAL isn't a closed box, it is just very very slow. The main reason you don't get access to geometry is it isn't evaluated with CGAL during a preview when OpenCSG is used to make pictures of it.

On Wed, 29 Jul 2020 at 01:03, Revar Desmera <[hidden email]> wrote:
About 3 months ago I submitted PR#3288 to OpenSCAD to provide full access to ClipperLib Boolean geometry. I’m still waiting to see if it will be accepted and merged. 


In the meantime, if you really need it, I’ve implemented 2D Boolean geometry in the BOSL2 library. It not yet a complete library yet, but if you really need it, the code is there. 


-Revar


On Jul 28, 2020, at 4:24 PM, Hugo Jackson <[hidden email]> wrote:

I know that there’s effectively no access to CGAL during interpretation, and that the dream of being able to poll for dimensions after transformation is going to remain a dream, but is the same true for Clipper?
I have been developing an increasing list of modules and functions that manipulate arrays of points and finding that very helpful for many modelling projects.
It would be fantastic if there was access to clipper’s 2D boolean functions like Union, Difference, Intersection etc… so my question is with regard to the availability of clipper functions in an OpenSCAD program. It it like CGAL and it’s just a closed box, or is it possible that OpenSCAD functions could be made available that performed 2D boolean operations on point lists?
I’m sure this has been asked before, but I did do some research and didn’t come up with any history on this matter, so I do apologize if this has been answered a thousand times before. I appreciate that the power of such functionality is so appealing that if it could be done it would have been done already, but I thought I’d ask.


_______________________________________________
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
_______________________________________________
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: Is Clipper as opaque as CGAL?

Ronaldo
Minkowski is a powerful tool for modeling. It is less used because it is not as easy to learn and it is very slow even on preview. The preview of a model involving minkowski could be dramatically speeded up if the way it is done avoided CGAL in its last step. As it was reported here, by Torsten, I think, minkowski operates by first decomposing the objects to be "added" in convex chunks. The appropriate pairs of chunks are then easily combined with minkowski (by a fast convex hull) and the union of all these combinations produces the final result. CGAL is responsible for the decomposition and the final union. This last step, the more demanding task, would be a lot faster if it was done like any other union in preview: using the z-buffer to avoid CGAL. A fast preview of minkowski would increase the productivity in the developing phase of a project, promoting a broader use of it, and pushing its reputation of being very slow just to the final model render.


I confess I don’t really know enough to even be asking intelligent questions… but I would submit that speed is not a primary concern if one has access to a functionality that can do something that would be extremely difficult to do otherwise. By way of comparison, I would suggest minkowski… which depending on its application adds signficant processing times for a render… on the other hand, I presume that for some users, that functionality is worth the wait… regardless of how long it takes.
Anyway, I appreciate that I”m probably mixing ‘problems’… in that boolean operations are a different animal than my dream of being able to get the boundaries of an object after an operation is performed rather than having to calculate what it will be independent of the actual operation.
Regardless… OpenSCAD is great!


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

Re: Is Clipper as opaque as CGAL?

nophead
Yes I think that would be a good usability improvement as long as convex decomposition isn't too slow. I haven't come across anything the CGAL does in a reasonable time.

On Wed, 29 Jul 2020 at 15:27, Ronaldo Persiano <[hidden email]> wrote:
Minkowski is a powerful tool for modeling. It is less used because it is not as easy to learn and it is very slow even on preview. The preview of a model involving minkowski could be dramatically speeded up if the way it is done avoided CGAL in its last step. As it was reported here, by Torsten, I think, minkowski operates by first decomposing the objects to be "added" in convex chunks. The appropriate pairs of chunks are then easily combined with minkowski (by a fast convex hull) and the union of all these combinations produces the final result. CGAL is responsible for the decomposition and the final union. This last step, the more demanding task, would be a lot faster if it was done like any other union in preview: using the z-buffer to avoid CGAL. A fast preview of minkowski would increase the productivity in the developing phase of a project, promoting a broader use of it, and pushing its reputation of being very slow just to the final model render.


I confess I don’t really know enough to even be asking intelligent questions… but I would submit that speed is not a primary concern if one has access to a functionality that can do something that would be extremely difficult to do otherwise. By way of comparison, I would suggest minkowski… which depending on its application adds signficant processing times for a render… on the other hand, I presume that for some users, that functionality is worth the wait… regardless of how long it takes.
Anyway, I appreciate that I”m probably mixing ‘problems’… in that boolean operations are a different animal than my dream of being able to get the boundaries of an object after an operation is performed rather than having to calculate what it will be independent of the actual operation.
Regardless… OpenSCAD is great!

_______________________________________________
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: Is Clipper as opaque as CGAL?

cacb
In reply to this post by Ronaldo
On 29.07.2020 16:26, Ronaldo Persiano wrote:

> Minkowski is a powerful tool for modeling. It is less used because it is
> not as easy to learn and it is very slow even on preview. The preview of
> a model involving minkowski could be dramatically speeded up if the way
> it is done avoided CGAL in its last step. As it was reported here, by
> Torsten, I think, minkowski operates by first decomposing the objects to
> be "added" in convex chunks. The appropriate pairs of chunks are then
> easily combined with minkowski (by a fast convex hull) and the union of
> all these combinations produces the final result. CGAL is responsible
> for the decomposition and the final union. This last step, the more
> demanding task, would be a lot faster if it was done like any other
> union in preview: using the z-buffer to avoid CGAL. A fast preview of
> minkowski would increase the productivity in the developing phase of a
> project, promoting a broader use of it, and pushing its reputation of
> being very slow just to the final model render.

The most complicated aspect of Minkowski is subdividing the original
model into a collection of convex parts. I don't think you can avoid
that by some preview smartness. The rest is not too difficult but it is
processor heavy. I have made an independent Carve-based implementation
of Minkowski, so I have a bit of experience.

Carsten Arnholm

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

Re: Is Clipper as opaque as CGAL?

tp3
On 29.07.20 18:09, Carsten Arnholm wrote:
> The most complicated aspect of Minkowski is subdividing the
> original model into a collection of convex parts. I don't
> think you can avoid that by some preview smartness.

Measurement with CGAL says there might be a chance:

http://forum.openscad.org/rendering-problem-tp29209p29225.html

Summary:

Minkowski: decomposed into 124 convex parts
Minkowski: decomposition took 1.029088 s
...
Minkowski: Computing union of 124 parts
Minkowski: Union done: 26.550561 s

Which again comes back to CGAL being especially slow
with unions.

ciao,
  Torsten.

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

Re: Is Clipper as opaque as CGAL?

JordanBrown
In reply to this post by nophead
On 7/29/2020 12:37 AM, nop head wrote:
CGAL isn't a closed box, it is just very very slow. The main reason you don't get access to geometry is it isn't evaluated with CGAL during a preview when OpenCSG is used to make pictures of it.

I started to write that, but then I saw that the OP asked about offering boolean operations on point lists, which is a different problem.  Or at least it's at a different point in the pipeline.


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

Re: Is Clipper as opaque as CGAL?

JordanBrown
In reply to this post by boxcarmib
On 7/29/2020 1:17 AM, Hugo Jackson wrote:
Anyway, I appreciate that I”m probably mixing ‘problems’… in that boolean operations are a different animal than my dream of being able to get the boundaries of an object after an operation is performed rather than having to calculate what it will be independent of the actual operation.

I'm pretty sure that in the general case you need to actually do the operation to determine the bounding box.

Scale, translate, union, hull, and I think Minkowski you can get the new bounding box from the old boxes without looking at the actual object.

Rotate, skew, intersect, and difference I think you need to actually do the operation.

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