auto-trace polyline from linear point cloud

Feel free to ask any question here
Post Reply
hairyfreak
Posts: 17
Joined: Sun Sep 07, 2014 2:46 pm

auto-trace polyline from linear point cloud

Post by hairyfreak »

Specific aim
Auto-create a polyline (to be used in profile extraction) from a simple set of points that mark the centre of this would-be line.

General aim
I want to extract some profile sections along the length of curved cylindrical shape that are perpendicular to the length of the object.
Current workflow is to extract cloud sections at small intervals along a straight line on my area of interest.
then.
Batch export the cloud info to file - this gives me a point file that maps to the median line of the shape.
then
I want these points turned into a polyline to use for wider-spaced profiling along this mid-line.
There are too many to trace polyline by hand.
I think I probably want to smooth this mid line too?
I think I can do it quickly in another 3D program, but would prefer to keep it to cloudcompare or cloudcompare+text editor if possible.
Am I missing something obvious?
Does this sound a like a plausible approach or am I going to get myself in a mess?

Many thanks in advance.
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: auto-trace polyline from linear point cloud

Post by daniel »

It doesn't look impossible, but I'm a bit lost. Can you post maybe a visual representation / snapshot / drawing of what you are describing?
Daniel, CloudCompare admin
hairyfreak
Posts: 17
Joined: Sun Sep 07, 2014 2:46 pm

Re: auto-trace polyline from linear point cloud

Post by hairyfreak »

Hi Daniel,

Thanks, see if this makes anymore sense.
Attachments
IMG_0675.jpg
IMG_0675.jpg (1.72 MiB) Viewed 9220 times
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: auto-trace polyline from linear point cloud

Post by daniel »

Wow, thanks for the drawing (much clearer).

And sadly, that looks much more complicated ಠ_ಥ

Sorry, I really don't see how to do this (well appart if you want to write a hell lot of code ;)
Daniel, CloudCompare admin
hairyfreak
Posts: 17
Joined: Sun Sep 07, 2014 2:46 pm

Re: auto-trace polyline from linear point cloud

Post by hairyfreak »

No worries and thanks!

Is there a way to script CloudCompare simply or would it require creating a plugin or some such? (not that I'm likely to get round to it, but maybe one day)
hairyfreak
Posts: 17
Joined: Sun Sep 07, 2014 2:46 pm

Re: auto-trace polyline from linear point cloud

Post by hairyfreak »

If it's useful to anyone else some of it can be done with blender. It won't suit everyone's needs and it depends greatly the shape of the object and the density of the cloud for example but loosely you do this.

Use the section tool for a rough line along your object and extract slices

tools->batch export->object info

open this csv back into CC
save as ply (can't figure out opening csv in blender at the mo)
open ply in blender

go into edit mode, and extrude all points slightly to one side
save the selected vertices as vertex group
select all
bridge edge loops
select the vertex group and delete leaving only original vertices now joined up

perform smoothing and point filling operations as you require. (top tip, deselect the first and last vertices when smoothing or the line will contract)

export as obj or dxf (make sure your axis are consistent (y forward z up etc)

open in CC - you now have a line following the estimated midpoints with sections that angle smoothly along the shape.

It's not flawless or fully automatic, The mid point estimates will be different depending on your starting rough line, how many slices you make etc, but looks like it should be with in tolerance for my needs, but testing that will come later.

If anyone has something more elegant, or mathematical please say!

Oh, and i'm also having trouble getting the line back in as a polyline, rather than a lot of segments. It's not detrimental to my needs, but for larger more complex objects it would be nicer to have one line.
Attachments
Screenshot 2019-09-23 at 16.12.36.jpg
Screenshot 2019-09-23 at 16.12.36.jpg (36.74 KiB) Viewed 9118 times
hairyfreak
Posts: 17
Joined: Sun Sep 07, 2014 2:46 pm

Re: auto-trace polyline from linear point cloud

Post by hairyfreak »

I should really rename the topic, but a friend pointed me to this that looks just the ticket:
will try and come back to this at a later date, but for now...

PCS: Prominent Cross-Sections for Mesh Models
https://engineering.purdue.edu/PRECISE/ ... -Final.pdf
daniel
Site Admin
Posts: 7707
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: auto-trace polyline from linear point cloud

Post by daniel »

Ah ah that looks like the way to go indeed ;)
Daniel, CloudCompare admin
Post Reply