10. SRA plugin
SRA is a standard plugin of cloudComPy.
The availability of the plugin can be tested with the cloudComPy.isPluginSRA()
function:
isSRA_available = cc.isPluginSRA()
SRA is a submodule of cloudCompy:
import cloudComPy as cc
# ...
if cc.isPluginSRA():
import cloudComPy.SRA
cc.SRA.loadProfile(...)
- class cloudComPy.SRA.qSRA
We only use the static method doComputeRadialDists of this class.
- doComputeRadialDists(self: _SRA.qSRA, arg0: _cloudComPy.ccPointCloud, arg1: _cloudComPy.ccPolyline) bool
Computes the radial distances between the cloud and the surface of revolution. A new scalarField named “Radial distance” is created.
- Parameters:
cloud (ccPointCloud) – the point cloud
profile (ccPoyline) – the profile loaded with loadProfile
- cloudComPy.SRA.loadProfile(arg0: str, arg1: int, arg2: bool) _cloudComPy.ccPolyline
Load profile from a dedicated text file. The format is given in CloudCompareGUI and in Python tests.
- Parameters:
filename (string) – text file giving the revolution profile
axisDim (int,optional) – revolution axis, from (0, 1, 2) = (oX, oY, oZ), default 2 = oZ
isAbsoluteHeightValues (bool,optional) – default False
- Returns:
a ccPolyline
- Return type:
ccPolyline (None if problem)
- cloudComPy.SRA.exportMapAsCloud(cloud: _cloudComPy.ccPointCloud, profile: _cloudComPy.ccPolyline, sf: _cloudComPy.ccScalarField, angStep_deg: float, yStep: float, yMin: float, yMax: float, isConical: bool = False, ccw: bool = False, fillSt: _SRA.FillStrategyType = <FillStrategyType.FILL_STRAT_AVG_DIST: 1>, fillOpt: _SRA.EmptyCellFillOption = <EmptyCellFillOption.FILL_INTERPOLATE: 2>, baseRadius: float = 1.0) _cloudComPy.ccPointCloud
Export the map of radial distances as a point cloud.
- Parameters:
cloud (ccPointCloud) – the point cloud used in radial distances computation
profile (ccPoyline) – the profile used in radial distances computation
sf (ccScalarField) – the “Radial distances” scalar field computed with doComputeRadialDists
angStep_deg (double) – the angle step of the map, in degrees
yStep (double) – the axial step of the map
yMin (double) – minimum axial value of the map
yMax (double) – maximum axial value of the map
isConical (bool,optional) – whether the projection is conical or cylindric, default False, i.e. cylindric projection
ccw (bool,optional) – whether the rotation is counter clockwise or not, default False i.e. clockwise
fillSt (int,optional) – fill strategy from cc.SRA.FillStrategyType, default cc.SRA.FILL_STRAT_AVG_DIST = average distance
fillOpt (int,optional) – fill option from cc.SRA.EmptyCellFillOption, default cc.SRA.FILL_INTERPOLATE = interpolation
baseRadius (double,optional) – default 1.0. The dimension of the map along angular axis will be 2*pi*baseRadius
- Returns:
a point cloud for the map
- Return type:
- cloudComPy.SRA.exportMapAsMesh(cloud: _cloudComPy.ccPointCloud, profile: _cloudComPy.ccPolyline, sf: _cloudComPy.ccScalarField, angStep_deg: float, yStep: float, yMin: float, yMax: float, isConical: bool = False, ccw: bool = False, fillSt: _SRA.FillStrategyType = <FillStrategyType.FILL_STRAT_AVG_DIST: 1>, fillOpt: _SRA.EmptyCellFillOption = <EmptyCellFillOption.FILL_INTERPOLATE: 2>, baseRadius: float = 1.0, colScale: _cloudComPy.DEFAULT_SCALES = <DEFAULT_SCALES.BGYR: 0>, colScaleSteps: int = 256) _cloudComPy.ccMesh
Export the map of radial distances as a mesh.
- Parameters:
cloud (ccPointCloud) – the point cloud used in radial distances computation
profile (ccPoyline) – the profile used in radial distances computation
sf (ccScalarField) – the “Radial distances” scalar field computed with doComputeRadialDists
angStep_deg (double) – the angle step of the map, in degrees
yStep (double) – the axial step of the map
yMin (double) – minimum axial value of the map
yMax (double) – maximum axial value of the map
isConical (bool,optional) – whether the projection is conical or cylindric, default False, i.e. cylindric projection
ccw (bool,optional) – whether the rotation is counter clockwise or not, default False i.e. clockwise
fillSt (int,optional) – fill strategy from cc.SRA.FillStrategyType, default cc.SRA.FILL_STRAT_AVG_DIST = average distance
fillOpt (int,optional) – fill option from cc.SRA.EmptyCellFillOption, default cc.SRA.FILL_INTERPOLATE = interpolation
baseRadius (double,optional) – default 1.0. The dimension of the map along angular axis will be 2*pi*baseRadius
colScale (int,optional) – from cc.SRA.colorScales default cc.SRA.DEFAULT_SCALES.BGYR
colScaleSteps (int,optional) – number of steps in the colorScale, default 256
- Returns:
a mesh for the map
- Return type:
- cloudComPy.SRA.initTrace_SRA() None
Debug trace must be initialized for each Python module.
Done in module init, following the value of environment variable _CCTRACE_ (“ON” if debug traces wanted)
- class cloudComPy.SRA.FillStrategyType
Members:
FILL_STRAT_MIN_DIST
FILL_STRAT_AVG_DIST
FILL_STRAT_MAX_DIST
INVALID_STRATEGY_TYPE
- FILL_STRAT_AVG_DIST = <FillStrategyType.FILL_STRAT_AVG_DIST: 1>
- FILL_STRAT_MAX_DIST = <FillStrategyType.FILL_STRAT_MAX_DIST: 2>
- FILL_STRAT_MIN_DIST = <FillStrategyType.FILL_STRAT_MIN_DIST: 0>
- INVALID_STRATEGY_TYPE = <FillStrategyType.INVALID_STRATEGY_TYPE: 255>
- __init__(self: _SRA.FillStrategyType, value: int) None
- property name
- property value
- class cloudComPy.SRA.EmptyCellFillOption
Members:
LEAVE_EMPTY
FILL_WITH_ZERO
FILL_INTERPOLATE
- FILL_INTERPOLATE = <EmptyCellFillOption.FILL_INTERPOLATE: 2>
- FILL_WITH_ZERO = <EmptyCellFillOption.FILL_WITH_ZERO: 1>
- LEAVE_EMPTY = <EmptyCellFillOption.LEAVE_EMPTY: 0>
- __init__(self: _SRA.EmptyCellFillOption, value: int) None
- property name
- property value