MeshInspector / MeshLib

Mesh processing library
https://meshlib.io
Other
521 stars 59 forks source link

Curved cylinder #1376

Open xiaodongdong101 opened 1 year ago

xiaodongdong101 commented 1 year ago

Is there a algorithm that can convert 3d polyline to a triangle mesh as shown above? image image

Grantim commented 1 year ago

Hello!

Unfortunately right now we don't have such functionality, We will try to work on it later. Thanks for suggestion.

xiaodongdong101 commented 1 year ago

Thanks a lot.

Grantim commented 1 year ago

We have

/// Offsets polyline by converting it to voxels and building iso-surface
/// do offset in all directions
/// so result mesh is always closed
[[nodiscard]] MRMESH_API Expected<Mesh, std::string> offsetPolyline( const Polyline3& polyline, float offset, const OffsetParameters& params = {} );

it is not exactly your case, but it prouce simular output.

Grantim commented 1 year ago

Hello! We have just added https://github.com/MeshInspector/MeshLib/blob/7e840dfddf5a41db19cf5932c800a77f1ec7341d/source/MRMesh/MRMovementBuildBody.h#L25-L28

image image

image image

xiaodongdong101 commented 1 year ago

Thanks a lot

xiaodongdong101 commented 1 year ago

If my curves are curved, how do I better avoid intersections?

b981978a8bdc5d61f19efe725edfa09
Grantim commented 1 year ago

You can use Offset tool to fix it (by casting to voxels and back) https://github.com/MeshInspector/MeshLib/blob/5bb227da3716ddffbc948428538a21061fcd3cb3/source/MRMesh/MROffset.h#L59-L61

image image image image image

xiaodongdong101 commented 1 year ago

Thanks

xiaodongdong101 commented 1 year ago

Hello,I find that solidworks have this function-swept surface. 4ce233d1f844211f469f9da72e84f52 Will this special algorithm be added later?

Grantim commented 1 year ago

Thanks for pointing on it, we will try to improve our algorithm later!