ACloudViewer  3.9.4
A Modern Library for 3D Data Processing
ccTorus.cpp
Go to the documentation of this file.
1 // ----------------------------------------------------------------------------
2 // - CloudViewer: www.cloudViewer.org -
3 // ----------------------------------------------------------------------------
4 // Copyright (c) 2018-2024 www.cloudViewer.org
5 // SPDX-License-Identifier: MIT
6 // ----------------------------------------------------------------------------
7 
8 #include <pybind11/pybind11.h>
9 #include <pybind11/stl.h>
10 #include <pybind11/stl_bind.h>
11 
12 #include <ecvTorus.h>
13 
14 #include "../casters.h"
15 
16 namespace py = pybind11;
17 using namespace pybind11::literals;
18 
19 void define_ccTorus(py::module &m)
20 {
21  py::class_<ccTorus, ccGenericPrimitive>(m, "ccTorus", R"doc(
22  ccTorus
23 
24  Parameters
25  ----------
26  insideRadius : PointCoordinateType
27  outsideRadius : PointCoordinateType
28  angleRad : float
29  subtended angle (in radians)
30  rectangularSection : bool
31  whether section is rectangular or round
32  rectSectionHeight : PointCoordinateType
33  section height (if rectangular torus)
34  transMat : , optional
35  optional 3D transformation (can be set afterwards with ccDrawableObject::setGLTransformation)
36  name : str, default: Sphere
37  name of the sphere object
38  precision : int, default: 24
39  drawing precision (angular step = 360/precision)
40  uniqueID : int, optional
41  unique ID (handle with care)
42 
43  Example
44  -------
45 
46  .. code:: Python
47 
48  torus = pycc.ccTorus(5.0, 10.0)
49  )doc")
50  .def(
51  py::init<PointCoordinateType,
53  double,
54  bool,
56  const ccGLMatrix *,
57  QString,
58  unsigned>(),
59  "insideRadius"_a,
60  "outsideRadius"_a,
61  "angleRad"_a = 2.0 * M_PI,
62  "rectangularSection"_a = false,
63  "rectSectionHeight"_a = 0,
64  "transMat"_a = nullptr,
65  "name"_a = QString("Torus"),
66  "precision"_a = []() { return ccTorus::DEFAULT_DRAWING_PRECISION; }());
67 }
constexpr double M_PI
Pi.
Definition: CVConst.h:19
float PointCoordinateType
Type of the coordinates of a (N-D) point.
Definition: CVTypes.h:16
void define_ccTorus(py::module &m)
Definition: ccTorus.cpp:19
Float version of ccGLMatrixTpl.
Definition: ecvGLMatrix.h:19
static const unsigned DEFAULT_DRAWING_PRECISION
Default drawing precision.
Definition: ecvTorus.h:21