13. 2D Polygons

13.1. ccFacets

class cloudComPy.ccFacet

Bases: ccHObject

Facet: Composite object: point cloud + 2D1/2 contour polyline + 2D1/2 surface mesh

static Create(cloud: _cloudComPy.GenericIndexedCloudPersist, maxEdgeLength: float = 0, transferOwnership: bool = False, planeEquation: List[float] = []) _cloudComPy.ccFacet

Creates a facet from a set of points.

The facet boundary can either be the convex hull (maxEdgeLength = 0) or the concave hull (maxEdgeLength > 0).

Parameters
  • cloud (GenericIndexedCloudPersist) – cloud from which to create the facet

  • maxEdgeLength (int,optional) – max edge length (if possible - ignored if 0), default 0.

  • transferOwnership (bool,optional) – if true and the input cloud is a ccPointCloud, it will be ‘kept’ as ‘origin points’. default False.

  • planeEquation (tuple(float),optional) – to input a custom plane equation: [a, b, c, d] as ‘ax+by+cz=d’, default []

Returns

a facet (or 0 if an error occurred)

Return type

ccFacet

addChild(self: _cloudComPy.ccHObject, child: _cloudComPy.ccHObject, dependencyFlags: int = <DEPENDENCY_FLAGS.DP_NONE: 0>, insertIndex: int = -1) bool

Adds a child.

warning the C++ default for DEPENDENCY_FLAGS (DP_PARENT_OF_OTHER) is replaced by DP_NONE in Python: The other values may induce a delete of the original child object in C++, not handled correctly on the Python side.

Parameters
  • child (ccHObject) – child instance to append to the child list

  • dependencyFlags (DEPENDENCY_FLAGS,optional) – dependency flags, default DP_NONE

  • insertIndex (int,optional) – insertion index, default -1: if <0, child is simply appended to the children list.

Returns

success

Return type

bool

clone(self: _cloudComPy.ccFacet) _cloudComPy.ccFacet

Clones this facet.

Returns

facet clone

Return type

ccFacet

colorsShown(self: _cloudComPy.ccHObject) bool

Returns True if the colors are shown, False otherwise. It is used to prepare the state of the entity when it is saved in a .bin format, for reopening in the GUI in a predefined state (colors, normal, scalarFields).

Returns

whether the colors are shown.

Return type

bool

getCenter(self: _cloudComPy.ccFacet) Vector3Tpl<T>

Returns the facet center.

Returns

facet center coordinates

Return type

tuple

getChild(self: _cloudComPy.ccHObject, arg0: int) _cloudComPy.ccHObject

Get child by index.

Parameters

index (int) – index of child, see getChildrenNumber().

Returns

child object

Return type

ccHObject

getChildCountRecursive(self: _cloudComPy.ccHObject) int

Get the number of children of this object, recursively.

Returns

number of children, recursively

Return type

int

getChildrenNumber(self: _cloudComPy.ccHObject) int

Get the number of direct children of this object.

Returns

number of direct children

Return type

int

getClassID(self: _cloudComPy.ccHObject) int

Get the type of this object.

Returns

type

Return type

CC_TYPE

getContour(self: _cloudComPy.ccFacet) _cloudComPy.ccPolyline

Returns contour polyline (if any).

Returns

contour polyline or None

Return type

ccPolyline

getContourVertices(self: _cloudComPy.ccFacet) _cloudComPy.ccPointCloud

Returns contour vertices (if any).

Returns

contour vertices or None

Return type

ccPointCloud

getName(self: _cloudComPy.ccHObject) QString

Get the name of the entity

Returns

entity name

Return type

str

getNormal(self: _cloudComPy.ccFacet) Vector3Tpl<T>

Returns the facet normal.

Returns

the facet normal

Return type

tuple

getOriginPoints(self: _cloudComPy.ccFacet) _cloudComPy.ccPointCloud

Returns origin points (if any).

Returns

origin points or None

Return type

ccPointCloud

getParent(self: _cloudComPy.ccHObject) _cloudComPy.ccHObject

Get the parent of this object.

Returns

parent object

Return type

ccHObject

getPlaneEquation(self: _cloudComPy.ccFacet) List[float]

Returns plane equation.

Returns

plane equation : [a, b, c, d] as ‘ax+by+cz=d’

Return type

tuple

getPolygon(self: _cloudComPy.ccFacet) _cloudComPy.ccMesh

Returns polygon mesh (if any).

Returns

polygon mesh or None

Return type

ccMesh

getRMS(self: _cloudComPy.ccFacet) float

Returns associated RMS (Root Mean Square).

Returns

RMS (Root Mean Square)

Return type

double

getSurface(self: _cloudComPy.ccFacet) float

Returns associated surface.

Returns

surface

Return type

double

hasColors(self: _cloudComPy.ccHObject) bool

Returns True if the entity has colors, False otherwise.

Returns

whether the entity has colors

Return type

bool

hasNormals(self: _cloudComPy.ccHObject) bool

Returns True if the entity has normals, False otherwise.

Returns

whether the entity has normals

Return type

bool

hasScalarFields(self: _cloudComPy.ccHObject) bool

Returns True if the entity has ScalarFields, False otherwise.

Returns

whether the entity has ScalarFields

Return type

bool

invertNormal(self: _cloudComPy.ccFacet) None

Inverts the facet normal.

isA(self: _cloudComPy.ccHObject, arg0: int) bool

Check the type of object.

Parameters

type (CC_TYPES) – type to check

Returns

OK if object is of this type

Return type

bool

isKindOf(self: _cloudComPy.ccHObject, arg0: int) bool

Check the type of object.

Parameters

type (CC_TYPES) – type to check

Returns

OK if object is a kind of this type

Return type

bool

normalsShown(self: _cloudComPy.ccHObject) bool

Returns True if the normals are shown, False otherwise. It is used to prepare the state of the entity when it is saved in a .bin format, for reopening in the GUI in a predefined state (colors, normal, scalarFields).

Returns

whether the normals are shown

Return type

bool

setContour(self: _cloudComPy.ccFacet, arg0: _cloudComPy.ccPolyline) None

Sets contour polyline.

Parameters

contour (ccPolyline) – contour polyline

setContourVertices(self: _cloudComPy.ccFacet, arg0: _cloudComPy.ccPointCloud) None

Sets contour vertices.

Parameters

vertices (ccPointCloud) – contour vertices

setName(self: _cloudComPy.ccHObject, arg0: QString) None

Set the name of the entity

Parameters

name (str) – entity name

setOriginPoints(self: _cloudComPy.ccFacet, arg0: _cloudComPy.ccPointCloud) None

Sets origin points.

Parameters

origin (ccPointCloud) – origin points

setPolygon(self: _cloudComPy.ccFacet, arg0: _cloudComPy.ccMesh) None

Sets polygon mesh.

Parameters

polygon (ccMesh) – polygon mesh

sfShown(self: _cloudComPy.ccHObject) bool

Returns True if the scalar fields are shown, False otherwise. It is used to prepare the state of the entity when it is saved in a .bin format, for reopening in the GUI in a predefined state (colors, normal, scalarFields).

Returns

whether the scalar fields are shown

Return type

bool

showColors(self: _cloudComPy.ccHObject, arg0: bool) None

Prepare the state of the entity when it is saved in a .bin format, for reopening in the GUI in a predefined state (colors, normal, scalarFields).

Parameters

isShown (bool) – whether to show or not the colors.

showNormals(self: _cloudComPy.ccHObject, arg0: bool) None

Prepare the state of the entity when it is saved in a .bin format, for reopening in the GUI in a predefined state (colors, normal, scalarFields).

Parameters

isShown (bool) – whether to show or not the normals.

showSF(self: _cloudComPy.ccHObject, arg0: bool) None

Prepare the state of the entity when it is saved in a .bin format, for reopening in the GUI in a predefined state (colors, normal, scalarFields).

Parameters

isShown (bool) – whether to show or not the ScalarFields.