Is there a way to project some 2D polylines on a triangulated mesh?

Feel free to ask any question here
Post Reply
swiss_knight
Posts: 28
Joined: Sun Aug 30, 2015 12:11 pm

Is there a way to project some 2D polylines on a triangulated mesh?

Post by swiss_knight »

Hi,

I've found this super tool: "Extract cloud sections along polylines or unfold a cloud along a polyline" which is really (really!) nice.
So, by using 2D polylines only, we can "cut" a cloud in the Z vertical plane formed by these lines. Giving this plane the thickness of our choice.

I wonder no if it's possible to do the same operation on a triangulated mesh?

For example, let's say we have a 2D polyline defined in the (X,Y) plane (Z=0) and a 3D triangulated mesh that has been done over a point cloud (there would be problems with the Poisson surface reconstruction plugin (Kazhdan et al), see below.)

1. Is it possible to "project" this 2D line onto the mesh so that we can give it Z values everywhere it crosses a triangle's edge (or by chance a vertex) and at every point constituting this line (the points that constitute the line may mainly fall onto triangles' surfaces) ?
So basically said, we need Z values at :
- intersection between the line's Z vertical plane and triangle's edges (eventually vertexes).
- every point defining the 2D line projected vertically onto the triangles' surface.

And thus making a really 3D polyline that perfectly fit the mesh triangles?


2. The Poisson surface recon' is a real 3D meshing process.
So we can end up with triangles pointing downwards (and thus having overlapping points which in many situation is not a good thing).
The 1. point above won't work on such meshes as we want 3D polyline that, for each (X,Y) value of the line have one and only one Z value.

I have seen (but not fully tested yet) the two 2.5D Delaunay triangulation.
What's the difference between them or how is the best fitting plane calculated (least square?)?
Is there any risks on steep slopes to have triangles with faces pointing downwards with the "best fitting plane" method? (I don't think so, but I'm not sure)
And finally, could we refine the mesh? For example with constraints on triangles like in J.R. Shewchuk's Triangle software: https://www.cs.cmu.edu/~quake/triangle.quality.html ?
These refinements may be of vital importance in any numeric simulations where exchanges of physical quantities are modelled between finite elements, here; the triangles.

Any help or advices appreciated, thanks a lot!
Kind Regards. :)
daniel
Site Admin
Posts: 7479
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: Is there a way to project some 2D polylines on a triangulated mesh?

Post by daniel »

That was a long post to digest ;) Then I almost forget to answer it :D

CC is not really a meshing tool (contrarily to Meshlab). And I personally don't use meshes therefore I'm not very "inclined" to spend a lot of time on adapting algorithms that were originally designed to work with clouds (sometimes it's very easy - in which case it's ok - but sometimes not). Of course if someone wants to do it, then his/her contribution will be gladly welcome.

1) The 'Trace polyline tool' can do this (but currently you have to manually trace the 2D polyline and set the correct mesh orientation). But it shouldn't be too hard to adapt it to load an existing polyline (for a motivated developer ;).

2) The 2.5D Delaunay triangulation is either constructed in the (XY) plane (Z is ignored), or by projecting first the points on the best fitting plane (Least Squares). If the cloud is 3D, then the points having the same (or almost the same) 2D position once projected (on the XY plane or on the best plane) will indeed cause very ugly triangles to appear (spikes, etc.).

The only existing refinement is to use polylines instead of points for the 2.5D triangulation (see 'Tools > Projection > Contour plot (polylines) to mesh'). In this case CC (CGAL in fact) will keep the input polylines in the resulting mesh.

Once again CC is not a meshing tool.
Daniel, CloudCompare admin
Post Reply