8 #include <pybind11/pybind11.h>
9 #include <pybind11/stl.h>
10 #include <pybind11/stl_bind.h>
16 #include "../casters.h"
19 using namespace pybind11::literals;
23 py::class_<ccQuadric, ccGenericPrimitive>(m,
"ccQuadric", R
"doc(
28 minCorner : cccorelib.CCVector2
29 min corner of the 'representation' base area
30 maxCorner : cccorelib.CCVector2
31 max corner of the 'representation' base area
32 eq: list of PointCoordinateType
33 equation coefficients ( Z = a + b.X + c.Y + d.X^2 + e.X.Y + f.Y^2)
35 dims: list of int, optional
36 optional dimension indexes
38 optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)
39 name : str, default: Sphere
40 name of the sphere object
47 quadric = pycc.ccQuadric(
48 cccorelib.CCVector2(5.0, 10.0),
49 cccorelib.CCVector2(10.0, 20.0),
50 [1.0, 2.0, 3.0, 4.0, 5.0, 6.0]
57 const py::sequence eq,
60 QString
name = QString(
"Quadric"),
66 throw py::value_error(
"eq must have 6 elements");
69 for (
size_t i{0}; i < 6; i++)
74 minCorner, maxCorner, eqC, dims, transMat, std::move(
name), precision);
80 "transMat"_a =
nullptr,
82 "name"_a = QString(
"Quadric"),
84 .def_property_readonly_static(
"DEFAULT_DRAWING_PRECISION",
float PointCoordinateType
Type of the coordinates of a (N-D) point.
void define_ccQuadric(py::module &m)
Float version of ccGLMatrixTpl.
const Tuple3ub & getEquationDims() const
const CCVector2 & getMaxCorner() const
Returns the quadric max corner.
QString getEquationString() const
Returns the quadric equation coefficients as a string.
const PointCoordinateType * getEquationCoefs() const
Returns the quadric equation coefficients.
static const unsigned DEFAULT_DRAWING_PRECISION
Default drawing precision.
const CCVector2 & getMinCorner() const
Returns the quadric min corner.
PointCoordinateType projectOnQuadric(const CCVector3 &P, CCVector3 &Q) const
Projects a 3D point in the quadric coordinate system.
static ccQuadric * Fit(cloudViewer::GenericIndexedCloudPersist *cloud, double *rms)
Fits a quadric primitive on a cloud.
A generic 3D point cloud with index-based and presistent access to points.