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

Create a separate component outputting the point cloud #24

Closed
mariuszhermansdorfer opened this issue Sep 6, 2019 · 7 comments
Closed
Assignees
Labels
new feature Adding new functionality
Milestone

Comments

@mariuszhermansdorfer
Copy link
Owner

As mentioned in #1 - we need a dedicated SW component outputting the point cloud

@mariuszhermansdorfer
Copy link
Owner Author

@philipbelesky
Copy link
Collaborator

philipbelesky commented Oct 21, 2019

Hey just a heads up that I've made a quick start, of sorts, on this in this branch. Currently itsless focused on the implementation by itself, but rather on setting up a base class or two that can be inherited by both a mesh-producing and point-cloud-producing component and cut down the amount of overlap in reading the basic sensor data, parsing options, logging/timing info etc.

@mariuszhermansdorfer
Copy link
Owner Author

I have looked into multiple ways of displaying the point cloud and the fastest by far was to use Rhino's native PC component. The only downside is that GH can't access it directly, so it would be a display only option.

  private PointCloud _cloud;
  private Point3f[] pointCloud;

  pointCloud = new Point3f[trimmedWidth * trimmedHeight];
 _cloud = new PointCloud(pointCloud);
 
  //Draw all points in this method.
  public override void DrawViewportWires(IGH_PreviewArgs args)
  {
    if (_cloud == null)
      return;

    args.Display.DrawPointCloud(_cloud, 3); // There is an overload which allows to input a color array too
  }

@philipbelesky
Copy link
Collaborator

So maybe there should be a parameter on that component (defaulting to off) that writes out a Point3D list if people ever need to manipulate the points further in Grasshopper?

Another option would be to check in with Cam and see if he wouldn't mind us employing the same methods as Tarsier. There would be quite a bit of value in using their GH_PointCloud class and being able to interoperate with their modification/search components.

@mariuszhermansdorfer
Copy link
Owner Author

I reached out to Cameron a few weeks ago regarding this. Don't know whether he knew, that you are part of the project at that time, but was still very open to us reusing his code.

Outputting a Point3d list is the slowest possible option. Much better to cast to GH_Point and spit these out. Cameron has posted some extensive test results in this thread.

@philipbelesky
Copy link
Collaborator

PC

Basic point cloud output works, although that was a very quick change. Getting the RGB colors and/or coloring the pixels based on analysis will need a bit more work.

Most of the work here has thus far been in trying to abstract out the shared methods between the new and old component. For that reason the merge-in for this one will be somewhat tricky, but new classes will allow me to start making some progress on #25 that should also illuminate how to handle the pixel-coloring in this case as well.

Regarding tarsier and their GH_PointCloud class, as tarsier is GLPv3 we would need to re-license Sandworm to match if the code was included. Would that be OK with you?

@mariuszhermansdorfer
Copy link
Owner Author

Very good work happening under the hood there! SandWorm desperately needed some clean-up. I need to finalize a few things for work this week and will have to keep it low-key in the next couple of days or so. Will get back to you as soon as I have more time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature Adding new functionality
Projects
None yet
Development

No branches or pull requests

2 participants