Skip to content
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

How to draw a box around a building (for example...) #164

Closed
mrosen opened this issue Mar 23, 2017 · 5 comments
Closed

How to draw a box around a building (for example...) #164

mrosen opened this issue Mar 23, 2017 · 5 comments

Comments

@mrosen
Copy link

mrosen commented Mar 23, 2017

First, let me say how impressed and thankful I am for this project. A Cross-platform Hackable Lidar Viewer is dearly needed and this on has a very strong start.

What I'd like to do is be able to draw either a 2D or 3D polygon (or perhaps just a box) manually and get the corresponding points. The intent is to load a point cloud, manually select some feature (manually recognized by a human) and extract the boundary. What is a good way forward for this?

My modest and possibly misdirected first attempt was to manually query the 3D cursor to find the edge points, manually write a .ply file that outlines those points and manually load the file into the running displaz server.

@c42f
Copy link
Owner

c42f commented Mar 25, 2017

Hi Michael, thanks for the kind words, it's great you're finding the project useful!

Given that you're willing to write code, I think you're going about this the right way (or at least the way I envisage people using the tool): let displaz take care of the 3D view, but build the logic for your application inside a simple program, in whichever programming language makes you happy :-)

What I've been trying to do is expose UI events via the command line, which allows an event driven script, driven by keybindings in the displaz window. If you look in the test directory, you'll see a script which does almost exactly what you want: https://github.com/c42f/displaz/blob/master/test/testhook_draw_polygons.sh, including incremental feedback. It's a bash script, so not exactly pretty, but hopefully you can see the idea, and see that it can be done in your language of choice.

Which language were you using to create your ply file, and which platform are you on, by the way? I haven't yet updated the simple language bindings (C,C++, matlab and python) to handle user interface callbacks. The julia bindings are more up to date in this regard (see https://github.com/c42f/Displaz.jl) and offer an event loop that you can hook into.

@c42f
Copy link
Owner

c42f commented Mar 25, 2017

By the way, it's sometimes hard to know which pieces to build into displaz, and which pieces to let people write themselves in a script. When you find things which are awkward or impossible from a script, I'm quite happy to entertain new features in the C++ code.

[edit] When I say "script" here, I'm really talking about any piece of code running outside the displaz process, which might, of course, be in a compiled language.

@mrosen
Copy link
Author

mrosen commented Mar 28, 2017 via email

@c42f
Copy link
Owner

c42f commented Mar 29, 2017

Great! As you say, the examples are lacking at this stage. I did a big documentation update a while back, but the IPC system has moved on a lot since then.

@c42f
Copy link
Owner

c42f commented Apr 7, 2017

Closing this issue in favour of #166 - the underlying problem is documentation for the new event loop stuff, I suppose.

@c42f c42f closed this as completed Apr 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants