CGAL / cgal

The public CGAL repository, see the README below
https://github.com/CGAL/cgal#readme
Other
4.95k stars 1.38k forks source link

Mesh Pipe #6292

Open petrasvestartas opened 2 years ago

petrasvestartas commented 2 years ago

Hi,

I would like to ask if there is any CGAL method or project that allows to create a pipe around a polyline? I could do it myself, but it seems that this a very common case that could be made my many people before me. If yes, could you point me to any example file.

image

lrineau commented 2 years ago

@CGAL/geometryfactory Do we not have a function, somewhere in the 3D demo, that allows to extrude a mesh along a curve?

sloriot commented 2 years ago

There used to be a branch but the code was not good enough and it was dropped. I do have a working version somewhere but I'd need some time to find it and put it inside a function.

petrasvestartas commented 2 years ago

Dear @lrineau and @sloriot ,

Thank you for your replies. It would be really nice have an example.

petrasvestartas commented 2 years ago

@sloriot Any update if the code is available?

sloriot commented 2 years ago

Sorry I don't have time for now.

sloriot commented 2 years ago

See #6317 which is working only on Surface_mesh. The code still need some work but at least it works.

GilesBathgate commented 2 years ago

I have this code for linear and rotate extrude:

Linear: https://github.com/GilesBathgate/RapCAD/blob/development/src/cgalprimitive.cpp#L660

Rotate: https://github.com/GilesBathgate/RapCAD/blob/development/src/cgalprimitive.cpp#L735

I would like to generalise it to sweep a polyline.

petrasvestartas commented 2 years ago

Thank you @sloriot and @GilesBathgate

Dear @GilesBathgate do you have a test example with a simple data-set of a polyline ? I assume I need to use all the file with necessary headers to run these two methods. Is it correct? And do I need to use the latest cgal version?

GilesBathgate commented 2 years ago

Dear @GilesBathgate do you have a test example with a simple data-set of a polyline ?

No. It doesn't work with a polyline, only a height, or a radius.

I assume I need to use all the file with necessary headers to run these two methods. Is it correct?

Yeah, it has a dependency on most of the rest of the project. You probably won't be able to use standalone. I provided it only for reference. Essentially what I do is find the perimeter of the source mesh (2d faces in 3d space), I find the normal of this perimeter using CGAL::normal_vector_newell_3 then I build sides and endcaps using the perimeter, making sure that the endcaps have the right winding with respect to the normal.

And do I need to use the latest cgal version?

No, it compiles against quite old CGAL versions.