PCofSG

by Tim C. Lueth, SG-Lib Toolbox: SolidGeometry 5.6 - VL/Vertices/PC/Clouds
Introduced first in SolidGeometry 4.3, Creation date: 2018-10-04, Last change: 2025-09-14

returns a point cloud from a SG with defined number of points and noise

Description

This recursive functions aborts if there is no change to create more points.
To speed up this recursive procedure set vgrid to zero, other wise a distribution of vgrid is tried.
The sample points are created using VLFLaddfacetcenterpoints.

could be improved by an addition view point vector to use only facets that can be seen from a view points

See Also: VLFLaddfacetcenterpoints

Example Illustration

 missing image of PCofSG(SG,nmax,vgrid,vnoise)

Syntax

[pc,NL]=PCofSG(SG,[nmax,vgrid,vnoise])

Input Parameter

SG: Solid Geometry
nmax: expected number of points; default is 30000
vgrid: grid size; defaults is 1/100 of sofBB; quick response with 0
vnoise: vertex noise in percent! 1 == 1/100 of sofBB; default is 0;

Output Parameter

pc: point cloud
NL: normal vector list of point cloud

Examples


PCofSG(SGbox([30,20,10]),3000);
PCofSG(SGsample(25),3000);
PCofSG(SGsample(25),3000,.2,1);




Copyright 2018-2025 Tim C. Lueth. All rights reserved. The code is the property of Tim C. Lueth and may not be redistributed or modified without explicit written permission. This software may be used free of charge for academic research and teaching purposes only. Commercial use, redistribution, modification, or reverse engineering is strictly prohibited. Access to source code is restricted and granted only under specific agreements. For licensing inquiries or commercial use, please contact: Tim C. Lueth

Last html export of this page out of FM database by TL: 2025-09-21