1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0029325: Modeling Algorithms - add tool BRepLib_PointCloudShape for generation point cloud for specified shape

Added PLY writing tools RWPly_CafWriter and RWPly_PlyWriterContext.

Added tool BRepLib_PointCloudShape generating point cloud from shape in two ways:
- random points on surface with specified density;
- points from triangulation nodes.

StdPrs_ToolTriangulatedShape::ComputeNormals() has been moved to
BRepLib_ToolTriangulatedShape for reusing outside of AIS.

Command vpointcloud has been extended to use new generation tool.
Command writeply has been added to write triangulation or point set into PLY format.
This commit is contained in:
gka
2017-11-08 17:13:53 +03:00
committed by smoskvin
parent ae38730d35
commit e2d60d0f7f
20 changed files with 2017 additions and 258 deletions

View File

@@ -5,3 +5,4 @@
005 gltf_lateload
006 obj_read
007 obj_write
008 ply_write

View File

@@ -0,0 +1,14 @@
puts "============"
puts "0029325: Modeling Algorithms - add tool BRepLib_PointCloudShape for generation point cloud for specified shape"
puts "============"
puts ""
pload XDE OCAF MODELING VISUALIZATION
set aNbPntsExpected 32581
set aTmpPly ${imagedir}/${casename}_tmp.ply
lappend occ_tmp_files $aTmpPly
restore [locate_data_file bug29325_EQUERRE.brep] aShape
set aNbPnts [writeply aShape $aTmpPly -pointCloud -dist 0.0 -dens 0.1 -colors 0]
if {$aNbPnts != $aNbPntsExpected} { puts "Error: ($aNbPnts) generated while expected ($aNbPntsExpected)" }

View File

@@ -0,0 +1,14 @@
puts "============"
puts "0029325: Modeling Algorithms - add tool BRepLib_PointCloudShape for generation point cloud for specified shape"
puts "============"
puts ""
pload XDE OCAF MODELING VISUALIZATION
set aNbPntsExpected 27890
set aTmpPly ${imagedir}/${casename}_tmp.ply
lappend occ_tmp_files $aTmpPly
restore [locate_data_file bug29325_SANGLE_DE_FIXATION.brep] aShape
set aNbPnts [writeply aShape $aTmpPly -pointCloud -dist 0.0 -dens 0.5 -colors 0]
if {$aNbPnts != $aNbPntsExpected} { puts "Error: ($aNbPnts) generated while expected ($aNbPntsExpected)" }

View File

@@ -21,7 +21,7 @@ vrotate 0.2 0.0 0.0
vdump $::imagedir/${::casename}_green.png
# random colors mode
vpointcloud p s -randcolors
vpointcloud p s -randcolors -nonormals
vdump $::imagedir/${::casename}_rand.png
# texture mapping