Grasshopper

algorithmic modeling for Rhino

Heya!

Does anyone know what the logic is behind the draw order of multiple custom preview components that have overlapping geometry?

I have 2 custom preview components in my def. One has solids as input, the other has PART of the wireframes of these solids as input.

The geometry of the second component gets hidden due to the other custom preview...

Thanks for looking in!

Views: 3271

Replies to This Discussion

Curves are showing through the solids, or completely obscuring them? Can you upload a screen shot?

In general there are some issues with custom display which cause curves to show through surfaces, polysurfaces, and meshes; as far as I know having one or multiple custom preview components doesn't make a difference.

I also found some odd thing, with custom display on pipes, even with the curves turned off that where piped, a curve is displayed through geometry where a custom previewed pipe is behind the geometry. http://www.grasshopper3d.com/video/grasshopper-flowline-modeling 

This is the same phenomenon - it's the "edge" of the pipe surface being treated like a curve. (All Breps and surfaces in custom display render their edges in the same manner as curves, if I'm not mistaken.) If you mesh the pipe before previewing this effect can be avoided.

yea I know, the nurbs display as edge always annoyed me :)

the edges of the solids completely obscure the curves (if i turn off the custom preview of the solids, the curves appear)

I ran into this again and i found a workaround: transforming the brep into a mesh (which actually leaves out  the edges entirely as long as Preview Mesh Edges is turned off), but i would still like to know what the logic behind the draw order of custom preview edges. Hopefully David Rutten will take a peak in here

First the DrawPreviewWires() methods of all components is called. In this method it makes sense to draw all things that cannot have transparency, such as wires, points and text. When all components have been iterated over, then the DrawPreviewMeshes() methods are called. The order in which components are drawn in the viewport is the same order as they are drawn on the canvas*

Rhino itself sorts objects from back to front prior to drawing them, in order to reduce the odds of a transparent object completely hiding geometry behind it. Grasshopper does not sort, so this is a rather common display artefact.

Other than that, if two pieces of geometry are at exactly the same depth-level it's a toss up which one ends up 'on top'.

* to be completely clear, the order the components had on the canvas during the most recent solution. Ctrl+B and Ctrl+F do not immediately affect the viewport sorting.

Thanks for the reply, David! Any interest in making this aspect controllable in a future release?

One more question/maybe bug report: If i use custom preview and i use a color swatch that has transparency as input, surfaces drawn behind the "see-through" one are completely obscured, like in the attached pic

Attachments:
Yup, that's the result of not sorting the objects prior to drawing. The frontmost transparent mesh is drawn first, it looks correctly transparent at the time of drawing. It also modifies the depth buffer, however this layer doesn't support any kind of transparency. Then later when objects ought to be drawn behind the transparent object, they are skipped because they are behind the current depth buffer.

Rhino jumps through a lot of hoops to always make it look right, I don't. The display will be rewritten from scratch too for GH2, and I'll definitely try and make it more robust this time.

Ok, thanks for the support!

That means for current GH we can only swallow the problem?

Absorb and deflect.

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service