-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
problem changing line_width_ or point_size_ for LineSet #6952
Comments
I have the similar confusion ,I find the changes invalid: |
Thanks @weixi234. I don't know how to fix this or work around it. So far, I have just been using the default tiny sizes. For future reference, RenderOption.h lists this information about the ranges and units of these line drawing parameters: const double POINT_SIZE_MAX = 25.0;
const double POINT_SIZE_MIN = 1.0;
const double POINT_SIZE_STEP = 1.0;
const double POINT_SIZE_DEFAULT = 5.0;
const double LINE_WIDTH_MAX = 10.0;
const double LINE_WIDTH_MIN = 1.0;
const double LINE_WIDTH_STEP = 1.0;
const double LINE_WIDTH_DEFAULT = 1.0; I am new to using Open3D from c++, and yes, the c++ API doc is often unhelpful. Open3D has many helpful usage examples, but they use the Python API. So a c++ user needs to translate, which can be error prone. |
Thinking about this just now, I recall a bug in Open3D 0.17.0 (?) where Before: vis.GetRenderOption().line_width_ = 1
vis.GetRenderOption().point_size_ = 5 After: vis.GetRenderOption().line_width_ = 10
vis.GetRenderOption().point_size_ = 20 |
I was reminded of this issue by a comment by @YuYuCodeNoob on #5637. That issue (from 2022, since closed) appears to be about the same kind of symptom as this issue: setting line width and point size. @YuYuCodeNoob's suggestion is to use So I tried to follow @YuYuCodeNoob's example, which is written in Python, by translating it to c++, using a lot of trial and error: void LineWidthPointSizeTest2()
{
open3d::PrintOpen3DVersion();
auto lineset = std::make_shared<open3d::geometry::LineSet>();
lineset->points_ = {{5, 0, 0}, {-5, 0, 0}, {0, 5, 0}, {0, -5, 0}, {0, 0, 5}, {0, 0, -5}};
lineset->lines_ = {{0, 1}, {2, 3}, {4, 5}};
lineset->colors_ = {{1, 0, 0}, {0, 1, 0}, {0, 0, 1}};
open3d::visualization::gui::Application::GetInstance().Initialize();
auto vis = open3d::visualization::visualizer::O3DVisualizer("name", 500, 500);
vis.AddGeometry("lines", {lineset});
vis.SetLineWidth(10);
vis.SetPointSize(20);
open3d::visualization::gui::Application::GetInstance().Run();
} I was able to get it to compile, but running it hit a problem with “resource directory”:
I see that I can supply a path for resource directory in an overload of Can anyone either tell me how to run |
Checklist
main
branch).Describe the issue
I cannot see any obvious change when I try to increase line_width_ or point_size_ for
LineSet
.I am setting
vis.GetRenderOption().line_width_ = 10.0;
My code calls Open3D from C++ using a version I built from source in the last new weeks. The main branch minus a few of the most recent commits.Steps to reproduce the bug
Error message
(visual problem)
Expected behavior
I wanted thicker lines. Setting
vis.GetRenderOption().line_width_ = 10.0
made no obvious difference. I also tried settingvis.GetRenderOption().point_size_ = 20.0
and the vertices do not appear any larger than the lines, which themselves appear no wider than the default.Open3D, Python and System information
Additional information
By the way, is there a way to use
open3d::PrintOpen3DVersion()
to get the exact version string "version+main_commit"? (Like: 0.18.0+18a47ef) Does this work fromopen3d.__version__
in Python?The text was updated successfully, but these errors were encountered: