libCGAL_CORE in openscad ?

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

libCGAL_CORE in openscad ?

Felipe Sanches
I'm implementing a new feature for openscad that uses the CGAL::create_interior_skeleton_and_offset_polygons_2 method to create polygon insets.
When I try to build, it fails during linkage complaining about unknown references to things like CORE::BigFloatRep::toDouble()

I've seen references online of people mentioning these as a result of not linking agains libCGAL_CORE. I'm not sure what it means, but I thing it wouldn't hurt to ask you.

I'm running a GNU/Linux distro (Trisquel). Any idea how to link openscad against this CGAL_CORE library?

happy hacking,
Felipe Sanches
Reply | Threaded
Open this post in threaded view
|

Re: libCGAL_CORE in openscad ?

kintel
Administrator
On 2012-11-25, at 21:10 , Felipe Sanches wrote:
>
> I'm running a GNU/Linux distro (Trisquel). Any idea how to link openscad against this CGAL_CORE library?
>
I can see that we just link against libCGAL, but I also have a libCGAL_Core on my system.

Perhaps add -lCGAL_Core to cgal.pri?

 -Marius


Reply | Threaded
Open this post in threaded view
|

Re: libCGAL_CORE in openscad ?

Giles Bathgate-2
On 26 November 2012 04:38, Marius Kintel <[hidden email]> wrote:
> I can see that we just link against libCGAL, but I also have a libCGAL_Core on my system.

Yes I recall having to link against libCGAL_Core when adding this
feature to RapCAD, Felipe by all means use RapCAD
http://git.rapcad.org/cgit.cgi/rapcad/tree/src/cgalbuilder.cpp the
function BuildOffsetPolygons as reference if its helpful.

Regards

Giles

Reply | Threaded
Open this post in threaded view
|

Re: libCGAL_CORE in openscad ?

Felipe Sanches
yes, I learned about RapCAD a few hours ago when googling for this CGAL method :-D

It is indeed helping me in development, thanks!

On Mon, Nov 26, 2012 at 12:14 PM, Giles Bathgate <[hidden email]> wrote:
On 26 November 2012 04:38, Marius Kintel <[hidden email]> wrote:
> I can see that we just link against libCGAL, but I also have a libCGAL_Core on my system.

Yes I recall having to link against libCGAL_Core when adding this
feature to RapCAD, Felipe by all means use RapCAD
http://git.rapcad.org/cgit.cgi/rapcad/tree/src/cgalbuilder.cpp the
function BuildOffsetPolygons as reference if its helpful.

Regards

Giles
_______________________________________________
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: libCGAL_CORE in openscad ?

Felipe Sanches
for instance, I'll keep the syntax compatible. I was first planning to introduce two modules: inset() and outset(), but your approach of having a single offset() module with negative distance values for inset and positive values for outset seems much better.

One issue: shoul we implement inset/outset "sheels" for 3d polihedra ? Otherwise, this feature would be available only for two-dimensional geometry.

happy hacking,
Felipe Sanches

On Mon, Nov 26, 2012 at 12:23 PM, Felipe Sanches <[hidden email]> wrote:
yes, I learned about RapCAD a few hours ago when googling for this CGAL method :-D

It is indeed helping me in development, thanks!


On Mon, Nov 26, 2012 at 12:14 PM, Giles Bathgate <[hidden email]> wrote:
On 26 November 2012 04:38, Marius Kintel <[hidden email]> wrote:
> I can see that we just link against libCGAL, but I also have a libCGAL_Core on my system.

Yes I recall having to link against libCGAL_Core when adding this
feature to RapCAD, Felipe by all means use RapCAD
http://git.rapcad.org/cgit.cgi/rapcad/tree/src/cgalbuilder.cpp the
function BuildOffsetPolygons as reference if its helpful.

Regards

Giles
_______________________________________________
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: libCGAL_CORE in openscad ?

Felipe Sanches
Another thing:

outset(distance=r){
    thing();
}

is a bit redundant with:

minkowski(){
    thing();
    sphere(r=r);
}

but I think it is good to have, since using minkowski for generating outsets is surely much slower than using a dedicated outset method.

Felipe

On Mon, Nov 26, 2012 at 12:26 PM, Felipe Sanches <[hidden email]> wrote:
for instance, I'll keep the syntax compatible. I was first planning to introduce two modules: inset() and outset(), but your approach of having a single offset() module with negative distance values for inset and positive values for outset seems much better.

One issue: shoul we implement inset/outset "sheels" for 3d polihedra ? Otherwise, this feature would be available only for two-dimensional geometry.

happy hacking,
Felipe Sanches


On Mon, Nov 26, 2012 at 12:23 PM, Felipe Sanches <[hidden email]> wrote:
yes, I learned about RapCAD a few hours ago when googling for this CGAL method :-D

It is indeed helping me in development, thanks!


On Mon, Nov 26, 2012 at 12:14 PM, Giles Bathgate <[hidden email]> wrote:
On 26 November 2012 04:38, Marius Kintel <[hidden email]> wrote:
> I can see that we just link against libCGAL, but I also have a libCGAL_Core on my system.

Yes I recall having to link against libCGAL_Core when adding this
feature to RapCAD, Felipe by all means use RapCAD
http://git.rapcad.org/cgit.cgi/rapcad/tree/src/cgalbuilder.cpp the
function BuildOffsetPolygons as reference if its helpful.

Regards

Giles
_______________________________________________
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: libCGAL_CORE in openscad ?

Giles Bathgate-2
On 26 November 2012 14:28, Felipe Sanches <[hidden email]> wrote:
> is a bit redundant with:
>
> minkowski(){
>     thing();
>     sphere(r=r);
> }

While that approach is theoretically correct, I believe the results
would be quite different due to the sphere not being a perfect sphere,
and being a polyhedral approximation of a sphere.

offset() for 3D polyhedra would be great, although I suspect quite
difficult to achieve. I believe you might be able to achieve it by
expanding the size of each 3D surface using 2D offset, and then
translating each face along its normal. It might get complex when
there are holes, and you have to work out whether to expand or
contract surfaces and which direction to translate each surface.

Reply | Threaded
Open this post in threaded view
|

Re: libCGAL_CORE in openscad ?

Felipe Sanches
I think that the same mathematical modeling of a straight skeleton used for 2d offsets may work for 3D geometry. I don't know whether CGAL implements three-dimensional straight skeletons and offsets, but if it doesnt then it could be a nice feature request for CGAL.

Felipe

On Mon, Nov 26, 2012 at 12:52 PM, Giles Bathgate <[hidden email]> wrote:
On 26 November 2012 14:28, Felipe Sanches <[hidden email]> wrote:
> is a bit redundant with:
>
> minkowski(){
>     thing();
>     sphere(r=r);
> }

While that approach is theoretically correct, I believe the results
would be quite different due to the sphere not being a perfect sphere,
and being a polyhedral approximation of a sphere.

offset() for 3D polyhedra would be great, although I suspect quite
difficult to achieve. I believe you might be able to achieve it by
expanding the size of each 3D surface using 2D offset, and then
translating each face along its normal. It might get complex when
there are holes, and you have to work out whether to expand or
contract surfaces and which direction to translate each surface.
_______________________________________________
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: libCGAL_CORE in openscad ?

Giles Bathgate-2
I suppose what I was trying to do was imagine a straight skeleton of a
irregular polyhedron in my head and imagined it as just being the
normals. No doubt its more complicated than I imagine.

Please do make a FR with the CGAL team.

Regards

Giles

Reply | Threaded
Open this post in threaded view
|

Re: libCGAL_CORE in openscad ?

nophead
Minkowski with a sphere or circle is not quite the same as an offset outwards, corners get rounded. I think it is the same when offsetting inwards but you have to do tricks to do that.

On 26 November 2012 15:56, Giles Bathgate <[hidden email]> wrote:
I suppose what I was trying to do was imagine a straight skeleton of a
irregular polyhedron in my head and imagined it as just being the
normals. No doubt its more complicated than I imagine.

Please do make a FR with the CGAL team.

Regards

Giles
_______________________________________________
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: libCGAL_CORE in openscad ?

Triffid Hunter
I for one would love an offset routine for doing shells, that would be awesome.

Did you know that the 2d polygon offset is the trickiest part of the whole slicing process?

Reply | Threaded
Open this post in threaded view
|

Re: libCGAL_CORE in openscad ?

Giles Bathgate-2

The fill algorithm isn't to easy either. I'd really like some tips for this so I can make some progress with rapcad

Reply | Threaded
Open this post in threaded view
|

Re: libCGAL_CORE in openscad ?

Joel Bodenmann
What's repcad? Google didn't help that much...


~ Tectu


On 11/27/2012 08:25 AM, Giles Bathgate wrote:

The fill algorithm isn't to easy either. I'd really like some tips for this so I can make some progress with rapcad



_______________________________________________
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: libCGAL_CORE in openscad ?

Giles Bathgate-2
Did you mean: RapCAD?