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.

__init__(self: _SRA.qSRA) None

Default constructor

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

ccPointCloud

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: _SRA.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

ccMesh

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
class cloudComPy.SRA.DEFAULT_SCALES

Members:

BGYR

GREY

BWR

RY

RW

ABS_NORM_GREY

HSV_360_DEG

VERTEX_QUALITY

DIP_BRYW

DIP_DIR_REPEAT

VIRIDIS

BROWN_YELLOW

YELLOW_BROWN

TOPO_LANDSERF

HIGH_CONTRAST

ABS_NORM_GREY = <DEFAULT_SCALES.ABS_NORM_GREY: 5>
BGYR = <DEFAULT_SCALES.BGYR: 0>
BROWN_YELLOW = <DEFAULT_SCALES.BROWN_YELLOW: 11>
BWR = <DEFAULT_SCALES.BWR: 2>
DIP_BRYW = <DEFAULT_SCALES.DIP_BRYW: 8>
DIP_DIR_REPEAT = <DEFAULT_SCALES.DIP_DIR_REPEAT: 9>
GREY = <DEFAULT_SCALES.GREY: 1>
HIGH_CONTRAST = <DEFAULT_SCALES.HIGH_CONTRAST: 14>
HSV_360_DEG = <DEFAULT_SCALES.HSV_360_DEG: 6>
RW = <DEFAULT_SCALES.RW: 4>
RY = <DEFAULT_SCALES.RY: 3>
TOPO_LANDSERF = <DEFAULT_SCALES.TOPO_LANDSERF: 13>
VERTEX_QUALITY = <DEFAULT_SCALES.VERTEX_QUALITY: 7>
VIRIDIS = <DEFAULT_SCALES.VIRIDIS: 10>
YELLOW_BROWN = <DEFAULT_SCALES.YELLOW_BROWN: 12>
__init__(self: _SRA.DEFAULT_SCALES, value: int) None
property name
property value