mariuszhermansdorfer / SandWorm

Augmented Reality Sandbox for Grasshopper & Rhino
MIT License
20 stars 11 forks source link

Better translate point cloud scale to Rhino scale #8

Closed philipbelesky closed 5 years ago

philipbelesky commented 5 years ago

It is often quite difficult to see that a point cloud is working properly because (in my experience) it comes into Rhino - usually less than 5mm x 5mm. Rhino's camera also behaves oddly when dealing with such small units and this often makes it difficult to navigate around the point cloud.

I'm not sure if the Kinect SDK can report in real-world units, or if this is just a mismatch between the assumed units the SDK reports and the coordinate system in Rhino. Even if scaling to the model's true size is not possible it would be nice to scale up by a generic quantity such that the point cloud is more at the scale of meters rather than mm.

Happy to investigate and add a PR, just wanted to check-in to see if this is was a desirable behavior.

mariuszhermansdorfer commented 5 years ago

Seems odd. Which Rhino template did you start with? I am working with 'Large objects - meters' and everything is scaled correctly here.

philipbelesky commented 5 years ago

Ah, I think I use large objects - mm as a default. To the extent that using mm is not an uncommon choice, would it be worth accounting for document units in the output of the component?

mariuszhermansdorfer commented 5 years ago

Makes total sense. Proper scaling should definitely be handled by the component or at least made transparent to the user what is going on in the background. The reason why it was obvious to me to go with meters is because ultimately I was going for modeling landscapes in real-world coordinates. This isn't necessarily the most common application, though.

mariuszhermansdorfer commented 5 years ago

Fixed in the latest commit.

`

        switch (units.ToString())
        {
            case "Kilometers":
                unitsMultiplier = 0.001;
                break;

            case "Meters":
                unitsMultiplier = 1;
                break;

            case "Decimeters":
                unitsMultiplier = 10;
                break;

            case "Centimeters":
                unitsMultiplier = 100;
                break;

            case "Millimeters":
                unitsMultiplier = 1000;
                break;

            case "Inches":
                unitsMultiplier = 39.3701;
                break;

            case "Feet":
                unitsMultiplier = 3.28084;
                break;
        }

`