24 #pragma warning(disable : 4715)
32 py::class_<ccFacet, PyGeometry<ccFacet>, std::shared_ptr<ccFacet>,
34 pyfacet(m,
"ccFacet", py::multiple_inheritance(),
35 "The Composite object: "
36 "point cloud + 2D1/2 contour polyline + 2D1/2 surface "
38 py::detail::bind_default_constructor<ccFacet>(pyfacet);
39 py::detail::bind_copy_functions<ccFacet>(pyfacet);
41 const std::string&
name) {
44 "-param max_edge_length max edge length (if possible - ignored "
48 "max_edge_length"_a = 0,
"name"_a =
"Facet")
52 double rms = facet.
getRMS();
53 unsigned facesNumber = 0;
54 unsigned verticeNumber = 0;
65 "ccFacet (with {} faces, {} points, area {}, "
66 "perimeter {}, rms {})",
67 facesNumber, verticeNumber, area, perimeter, rms);
70 .def(py::self + py::self)
71 .def(py::self += py::self)
74 "Returns associated surface area.")
76 "Gets normal vector mesh.",
"update"_a =
false)
82 "Sets the facet unique color.",
"color"_a)
88 "Returns the facet center.")
94 Eigen::Vector4d equation(4);
95 for (
size_t i = 0; i < 4; ++i) {
100 "Returns Plane equation - as usual in CC plane equation is "
103 "Inverts the facet normal.")
111 "[ccFacet] ccFacet do not have polygons!");
112 return std::ref(*std::make_shared<ccMesh>());
115 "Returns polygon mesh (if any)")
121 "Sets polygon mesh",
"mesh"_a)
129 "[ccFacet] ccFacet do not have contours!");
131 *std::make_shared<ccPolyline>(
nullptr));
134 "Returns contour polyline (if any)")
140 "Sets contour polyline",
"poly"_a)
142 "get_contour_vertices",
148 "[ccFacet] ccFacet do not have origin "
150 return std::ref(*std::make_shared<ccPointCloud>());
153 "Returns contour vertices (if any)")
155 "set_contour_vertices",
159 "Sets contour vertices",
"vertices"_a)
167 "[ccFacet] ccFacet do not have origin "
169 return std::ref(*std::make_shared<ccPointCloud>());
172 "Returns origin points (if any)")
178 "Sets origin points",
"cloud"_a)
182 return std::shared_ptr<ccFacet>(facet.
clone());
184 "Clones this facet.")
186 " Assigns facet the same color.",
"color"_a)
189 [](std::shared_ptr<ccPointCloud> cloud,
191 bool transfer_ownership,
192 const Eigen::Vector4d& plane_equation) {
197 "[ccFacet::Create] Illegal input "
198 "parameters, only support point cloud!");
199 return std::make_shared<ccFacet>();
203 for (
size_t i = 0; i < 4; ++i) {
208 persistCloud, max_edge_length,
210 plane_equation.isZero() ?
nullptr : eq);
211 return std::shared_ptr<ccFacet>(facet);
213 "Creates a facet from a set of points",
"cloud"_a,
214 "max_edge_length"_a = 0,
"transfer_ownership"_a =
false,
215 "plane_equation"_a = Eigen::Vector4d::Zero());
221 {{
"color",
"facet rgb color."}});
float PointCoordinateType
Type of the coordinates of a (N-D) point.
filament::Texture::InternalFormat format
static Vector3Tpl fromArray(const int a[3])
Constructor from an int array.
ccFacet * clone() const
Clones this facet.
ccMesh * getPolygon()
Returns polygon mesh (if any)
double getSurface() const
Returns associated surface area.
const PointCoordinateType * getPlaneEquation() const
Returns plane equation.
ccPolyline * getContour()
Returns contour polyline (if any)
void invertNormal()
Inverts the facet normal.
void setContour(ccPolyline *poly)
Sets contour polyline.
double getRMS() const
Returns associated RMS.
void setColor(const ecvColor::Rgb &rgb)
Sets the facet unique color.
void setContourVertices(ccPointCloud *cloud)
Sets contour vertices.
static ccFacet * Create(cloudViewer::GenericIndexedCloudPersist *cloud, PointCoordinateType maxEdgeLength=0, bool transferOwnership=false, const PointCoordinateType *planeEquation=nullptr)
Creates a facet from a set of points.
ccFacet & PaintUniformColor(const Eigen::Vector3d &color)
Assigns each line in the LineSet the same color.
const CCVector3 & getCenter() const
Returns the facet center.
ccPointCloud * getContourVertices()
Returns contour vertices (if any)
void setPolygon(ccMesh *mesh)
Sets polygon mesh.
std::shared_ptr< ccMesh > getNormalVectorMesh(bool update=false)
Gets normal vector mesh.
void setOriginPoints(ccPointCloud *cloud)
Sets origin points.
ccPointCloud * getOriginPoints()
Returns origin points (if any)
Hierarchical CLOUDVIEWER Object.
virtual unsigned size() const override
Returns the number of triangles.
Interface for a planar entity.
A 3D cloud and its associated features (color, normals, scalar fields, etc.)
PointCoordinateType computeLength() const
Computes the polyline length.
A generic 3D point cloud with index-based and presistent access to points.
unsigned size() const override
Returns the number of points.
constexpr static RgbTpl FromEigen(const Eigen::Vector3d &t)
void ClassMethodDocInject(py::module &pybind_module, const std::string &class_name, const std::string &function_name, const std::unordered_map< std::string, std::string > &map_parameter_body_docs)
void pybind_facet(py::module &m)
void pybind_facet_methods(py::module &m)
Generic file read and write utility for python interface.