truck icon indicating copy to clipboard operation
truck copied to clipboard

Convert surface with boundaries to triangle mesh for rendering

Open J-F-Liu opened this issue 3 years ago • 8 comments

Will this be implemented or not? I already find the Surface defination:

pub enum Surface {
    /// Plane
    Plane(Plane),
    /// 3-dimensional B-spline surface
    BSplineSurface(BSplineSurface<Vector3>),
    /// 3-dimensional NURBS Surface
    NURBSSurface(NURBSSurface<Vector4>),
    /// revoluted curve
    RevolutedCurve(Processor<RevolutedCurve<Curve>, Matrix4>),
}

J-F-Liu avatar May 13 '21 08:05 J-F-Liu

We have a plan, and we are experimenting with it whenever we have free time. However, I can't promise how long it will take, because we give higher priority to the implementation of STEP I/O, Euler operations, and set operations with the boundary representation.

ytanimura avatar May 19 '21 05:05 ytanimura

I already know B-spline and NURBS surface, can you recommand some readings about mathmatical theory of B-Rep surfaces? Thanks.

J-F-Liu avatar May 19 '21 08:05 J-F-Liu

Sorry, but I can't give you the best answer to this question. In fact, I have yet to find a definitive book on the subject. I tend to extrapolate from the specifications of existing CAD kernels, including OCCT. As for set operations, I plan to use this book as a reference, but I haven't compared it to several other books either.

ytanimura avatar May 19 '21 09:05 ytanimura

Now, a prototype version has been implemented. The difficult part of the Delaunay triangulation is left to the crate spade. This implementation is CPU-driven and may not provide the performance needed as the model grows in size. Currently, we are implementing some additional mesh algorithms for the test of this tessellation.

ytanimura avatar May 24 '21 09:05 ytanimura

I suspect that the CDT algorithm in spade cannot handle holes inside a polygon. The book Boundary Representation Modelling Techniques lacks detailed algorithms. I found the following paper which gives an appropriate solution to the problem:

Advancing Front Surface Mesh Generation in Parametric Space Using a Riemannian Surface Definition

J-F-Liu avatar Jul 02 '21 04:07 J-F-Liu

I suspect that the CDT algorithm in spade cannot handle holes inside a polygon.

That is right, If one specifies a boundary, the triangle will always be entirely outside or inside the domain. So, the current implementation excludes triangles whose center of gravity is outside the domain when converting data from spade to truck mesh structure. Although there is overlap, we consider that speeding up the process is an issue to be addressed after we have some functionality in place.

I found the following paper which gives an appropriate solution to the problem:

Thank you for the introduction. I will check it out in the near future.

ytanimura avatar Jul 04 '21 18:07 ytanimura

Found another paper: Gabriel-constrained Parametric Surface Triangulation

This approach looks better, only the algorithm to generate sample points is very slow, needs improvement.

J-F-Liu avatar Jul 23 '21 07:07 J-F-Liu

There is also this rust crate that looks very promising, which implements Manifold Dual Contouring: https://github.com/hmeyer/tessellation

g-rauhoeft avatar Jul 28 '21 14:07 g-rauhoeft