Skip to content

Commit

Permalink
Fix ccPolyline ctor keep_alive policy
Browse files Browse the repository at this point in the history
  • Loading branch information
tmontaigu committed Jun 19, 2024
1 parent 319982f commit 315aa66
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
4 changes: 3 additions & 1 deletion script_examples/crop2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
polyline.addPointIndex(0, vertices.size())

# To see the crop area
# CC.addToDB(vertices)
# CC.addToDB(polyline)


cropped_ref = pc_to_crop.crop2D(polyline, 2, True)
if cropped_ref is None:
Expand All @@ -34,3 +35,4 @@
CC.addToDB(cropped)
else:
print("No points fall in crop area")

4 changes: 3 additions & 1 deletion wrapper/pycc/src/qcc_db/ccPolyline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ void define_ccPolyline(py::module &m)
unsigned uniqueID = ccUniqueIDGenerator::InvalidUniqueID)
{ return new ccPolyline(cloud, uniqueID); }),
"associatedCloud"_a,
"uniqueID"_a = []() { return ccUniqueIDGenerator::InvalidUniqueID; }())
"uniqueID"_a = []() { return ccUniqueIDGenerator::InvalidUniqueID; }(),
py::keep_alive<1, 2>() // Keep cloud alive while polyline is
)

.def("set2DMode", &ccPolyline::set2DMode, "state"_a)
.def("is2DMode", &ccPolyline::is2DMode)
Expand Down

0 comments on commit 315aa66

Please sign in to comment.