Creating a view projection for Make2D

In GH in V7, we had the following in the Display>Dimensions menu:

In GH in V8, that component has been removed and this functionality has been integrated into the “Query Viewports” component under the Rhino menu:

This component puts out more info, not just the view, but also the viewport (there is a difference) plus the display mode that is currently active. You can plug it into a “Model View” component to get just the view:

Both of these are based on finding the viewport names. Viewport names are language-dependent. So, If I use the same thing in a French-speaking Rhino I get this:

because “Top” viewport doesn’t exist in a French Rhino template, it is called “Dessus”. You can of course right click on the ModelView component and “Set one view” but that defeats the purpose of having it automatically set. Dunno, maybe there is a way and I missed it.

So, I went looking for a way to specifically define a view projection (for a Make2D operation) that would be language-independent - like an underscore is when running Rhino commands. I thought it best to define the view projection geometrically rather than by name, therefore there would be no possible error. There is this component:

So I thought, that’s easy… But not really.

The component wants a rectangle input. That’s easy enough to define. However, not any rectangle that’s in the view plane you want will do. It has to be of the correct dimensions (big enough) and the camera at least has to be above the the objects used for the Make2D - WAY above, because it actually does have a conical frustum which will cut the objects if it’s not far away enough. Is there a camera input? No. AND, the rectangle has to have the correct CW/CCW orientation, otherwise the view points the wrong way. All that makes it a royal pain in the a$$ to set up correctly without getting it looking the wrong way or clipping your objects.

I don’t really understand why a parallel view projection can’t be simply defined as being normal to a plane. The plane has all the elements needed - orientation in space with the X and Y axes plus the Z normal. The extents should be unlimited (as in a plane) as this is a parallel projection… But this is not possible.

Anyway, that leads me to my request:
As in vectors with unit X, Y and Z components and planes with World XY, YZ and ZX components, we need universal Top, Front and Right view components that can be plugged directly into a Make2D or a ModelView component and work in any language. Perhaps they could even have an “invert” Boolean so we could get Bottom, Back and Left.

2 Likes

Valid points you bring up. There is another Make2D component that gives you a bit more freedom (in my opinion)

Make2D:

Here’s how I’ve been using a bounding box to create oriented views and dynamic Make2D. Maybe it will help? Obviously doesn’t account for the language issue though.

Graph Space:

Model Space:

20230626_Make2D_Dynamic_01a.gh (22.3 KB)

Still way too complicated - this needs to be simple for anyone to use! When you Make2D in Rhino, you just choose the objects, the view(s) and go!

I’ve been playing around with it some more, based on your bounding box deconstruction. Turns out the Make2D Parallel view will actually accept a face of the deconstructed box. However, it still gets the directions wrong:

3 should be “Left” and 5 should be “Top”…

This is the object:

And here are the results:

0 - Should be Front - OK, but rotated.

1 - Should be Right - OK, but also rotated.

2 - Should be Back- OK, but also rotated.

3 - Should be Left - nothing done, normal facing the wrong way

4 - Should be Bottom - OK, but rotated

5 - Should be Top - nothing done, normal facing the wrong way

This is just… bad.

2 Likes

Hmm, yea it seems like it needs a plane input over a vector. In one of these nodes I thought I saw something of the like. Perhaps it’s the view node that lets you create a camera with location/target and a plane.

I’m going to dig into it a little bit more

EDIT: it seems that in my version of the script it appears to orient the make2D correctly as well as the views that are generated.

Baked Views:

Make2D Named By Views:

I agree that it has too many steps still…

And I really wish the Make2D component I am using in the cluster had the boolean value exposed so that we could programmatically toggle updating the component
20230626_Make2D_Dynamic_01b.gh (29.0 KB)

Thanks guys, I’ve added a couple youtracks. I’ve gone through similar issues with the Rhino.Inside.Revit components. Once additional casting was added and some clarifications to users on what is required to make a view things are working much better.

Let me know if there’s anything to add…

https://mcneel.myjetbrains.com/youtrack/issue/RH-75510/Rhino-8-Grasshopper-Query-Viewports-language-support-needed.

https://mcneel.myjetbrains.com/youtrack/issue/RH-75511/Grasshopper-GH1-Make2D-Boolean-toggle-feature-request.

https://mcneel.myjetbrains.com/youtrack/issue/RH-75513/Grasshopper-GH1-add-additional-casting-for-View-Creation

2 Likes

Thanks Japhy, can you make these visible to all users?

1 Like

Thanks for adding Japhy

So I decided to be completely neanderthal about this and created my own ortho view generator based on the bounding box vertices. Basically it consists of winding the rectangles (polylines) the right way around for each face. It’s counterintuitive for anyone used to creating scripted geometry, because you need to wind the rectangles in the CW direction facing the view - whereas normally one creates closed curves in the CCW direction. So for the top one would have the habit of making the rectangle EFGH, but in fact that faces “up” and from top view you want to look “down”. So you need to use FEHG instead - like you flipped it over 180°.

The inside of the cluster looks like this:

I sincerely hope all this will be made useless soon with better components…

Have you tried to use a mesh box instead of a brep?

Brep face normals and point order seems to be inconsistent. Mesh box looks correct.

I think this can easily be solved by simply passing a Plane into the Make2D component’s View input. You can use any of the World XY, YZ, or XZ planes (or really any plane) as an input for a View. The only catch is that you need to make sure the geometry is on the correct side of the plane so that the Make2D properly captures the geometry. For example, in the image below I had some geometry at the origin point. I needed to move the World XY plane up in the Z-axis before feeding it into the Make2D component since the view that is created will be pointing downwards. If I wanted a “bottom” view, then I would need to flip this plane and move it below the geometry. Hopefully this makes sense.


Make2DView.gh (405.8 KB)

2 Likes

Hi, I’ve downloaded your gh file but I have an error going from the move component to the view component, I think I may be missing some plug in or something

I guess I’m confused as there aren’t any components in between the Move component and the Make 2D component. Can you post a screenshot of the error? Can you report what the error message says? Are you using Rhino 8? These should all be native Grasshopper components.

oh that may be the problem, I’m using Rhino 7

I’m a student, do you know if I can get Rhino 8 with my license?

Ok. yes, that makes sense. We made some changes in Rhino 8 when we added some of the new native components to handle Rhino Views.