21 py::class_<LineSet, PyGeometry<LineSet>, std::shared_ptr<LineSet>,
24 "LineSet define a sets of lines in 3D. A typical "
25 "application is to display the point cloud correspondence "
27 py::detail::bind_default_constructor<LineSet>(lineset);
28 py::detail::bind_copy_functions<LineSet>(lineset);
29 lineset.def(py::init<
const std::vector<Eigen::Vector3d> &,
30 const std::vector<Eigen::Vector2i> &>(),
31 "Create a LineSet from given points and line indices",
32 "points"_a,
"lines"_a)
35 return std::string(
"LineSet with ") +
38 .def(py::self + py::self)
39 .def(py::self += py::self)
41 "Returns ``True`` if the object contains points.")
43 "Returns ``True`` if the object contains lines.")
45 "Returns ``True`` if the object's lines contain "
50 "Assigns each line in the line set the same color.",
"color"_a)
51 .def_static(
"create_from_point_cloud_correspondences",
53 "Factory function to create a LineSet from two "
54 "pointclouds and a correspondence set.",
55 "cloud0"_a,
"cloud1"_a,
"correspondences"_a)
56 .def_static(
"create_from_oriented_bounding_box",
58 "Factory function to create a LineSet from an "
59 "OrientedBoundingBox.",
61 .def_static(
"create_from_axis_aligned_bounding_box",
63 "Factory function to create a LineSet from an "
64 "AxisAlignedBoundingBox.",
66 .def_static(
"create_from_triangle_mesh",
68 "Factory function to create a LineSet from edges of a "
72 "Factory function to create a LineSet from edges of a "
75 .def_static(
"create_camera_visualization",
77 "Factory function to create a LineSet from intrinsic "
78 "and extrinsic camera matrices",
79 "view_width_px"_a,
"view_height_px"_a,
"intrinsic"_a,
80 "extrinsic"_a,
"scale"_a = 1.0)
82 "create_camera_visualization",
84 const Eigen::Matrix4d &extrinsic,
double scale) {
89 "Factory function to create a LineSet from intrinsic "
90 "and extrinsic camera matrices",
91 "intrinsic"_a,
"extrinsic"_a,
"scale"_a = 1.0)
93 "``float64`` array of shape ``(num_points, 3)``, "
94 "use ``numpy.asarray()`` to access data: Points "
97 "``int`` array of shape ``(num_lines, 2)``, use "
98 "``numpy.asarray()`` to access data: Lines denoted "
99 "by the index of points forming the line.")
102 "``float64`` array of shape ``(num_lines, 3)``, "
103 "range ``[0, 1]`` , use ``numpy.asarray()`` to access "
104 "data: RGB colors of lines.");
109 {{
"line_index",
"Index of the line."}});
111 {{
"color",
"Color for the LineSet."}});
113 m,
"LineSet",
"create_from_point_cloud_correspondences",
114 {{
"cloud0",
"First point cloud."},
115 {
"cloud1",
"Second point cloud."},
116 {
"correspondences",
"Set of correspondences."}});
118 "create_from_oriented_bounding_box",
119 {{
"box",
"The input bounding box."}});
121 "create_from_axis_aligned_bounding_box",
122 {{
"box",
"The input bounding box."}});
124 {{
"mesh",
"The input triangle mesh."}});
126 {{
"mesh",
"The input tetra mesh."}});
virtual bool hasColors() const
Returns whether colors are enabled or not.
Hierarchical CLOUDVIEWER Object.
Contains the pinhole camera intrinsic parameters.
int height_
Height of the image.
int width_
Width of the image.
Eigen::Matrix3d intrinsic_matrix_
LineSet define a sets of lines in 3D. A typical application is to display the point cloud corresponde...
std::pair< Eigen::Vector3d, Eigen::Vector3d > GetLineCoordinate(size_t line_index) const
Returns the coordinates of the line at the given index.
static std::shared_ptr< LineSet > CreateFromTetraMesh(const TetraMesh &mesh)
static std::shared_ptr< LineSet > CreateCameraVisualization(int view_width_px, int view_height_px, const Eigen::Matrix3d &intrinsic, const Eigen::Matrix4d &extrinsic, double scale=1.0)
std::vector< Eigen::Vector3d > points_
Points coordinates.
std::vector< Eigen::Vector3d > colors_
RGB colors of lines.
bool HasLines() const
Returns true if the object contains lines.
std::vector< Eigen::Vector2i > lines_
Lines denoted by the index of points forming the line.
static std::shared_ptr< LineSet > CreateFromOrientedBoundingBox(const ecvOrientedBBox &box)
Factory function to create a LineSet from an OrientedBoundingBox.
static std::shared_ptr< LineSet > CreateFromPointCloudCorrespondences(const ccPointCloud &cloud0, const ccPointCloud &cloud1, const std::vector< std::pair< int, int >> &correspondences)
Factory function to create a LineSet from two PointClouds (cloud0, cloud1) and a correspondence set.
static std::shared_ptr< LineSet > CreateFromTriangleMesh(const ccMesh &mesh)
static std::shared_ptr< LineSet > CreateFromAxisAlignedBoundingBox(const ccBBox &box)
Factory function to create a LineSet from an ccBBox.
LineSet & PaintUniformColor(const Eigen::Vector3d &color)
Assigns each line in the LineSet the same color.
bool HasPoints() const
Returns true if the object contains points.
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_lineset(py::module &m)
void pybind_lineset_methods(py::module &m)
Generic file read and write utility for python interface.
std::string to_string(const T &n)