Find visible geometry

Is it possible to get only all VISIBLE geometry?

For example : i have a face and behind the face is a line. Is it possible to get only the visible part of that line ?
Could i do something like that using the view or aany other options that i dont know of?

I need to find a solution for this problem:
I have a very complex 3D component that i view from a predefined angle and side. I need to produce a 2D image from only the visible geometry in that view.

If this is just for a 2D image export you should only see visible edges. Can you show us exactly what you’ve got?

All the 2D image exporters only show what is visible on your screen.

What i basically need is an array of all visible edges or faces. If an edge is behind something and therefor partly invisible, i only want to get the visible part(s). I need the geometry, so i can modify, use, store etc that geometry in memory.

“Can you show us exactly what you’ve got?” => From a component i can produce an array with faces and i can filter that partly using the normal of the faces. But in that case i will get full faces/edges, also the not visible parts. Defining whats visible / not visible is of corse possible, but i have components with 100’s of faces and im sure there must be a better way. If i export to DWG, i do get an export with all visible geometry, but i like to get that result without the need to do an export.

Is this a developer question, if so put it in the correct category.

2 Likes

Use the DWG, DXF, EPS or PDF format when exporting from SketchUp.

Alas, this is not a simple matter. Visibility is determined via z-buffering in the graphics card, not by the model geometry itself. For example, if a face obscures part of another face or edge, the obscured object itself is not affected; there is no actual split in the geometry. In fact, there isn’t even an actual split in the data on the GPU - it just switches from showing one thing to showing another at the boundary.

So, there is nothing you can directly retrieve to get what you want. You would have to do your own z-buffer rendering in the CPU, keeping track of the points and edges where the obscuring occurs in your own geometry database. That would be both complex and very slow if implemented in Ruby.

4 Likes

I am aware this is not an easy matter and resolving visibility using Ruby is indeed complex and slow. I did a few attempts but results are not what i want in the end.

Exporting to DXF/DWG with specific settings and then importing the result gives me a more usable set of geometry, but i dont want to follow that road. If i could only could get that kind of result without the need to export first, that would help me a lot.

Perhaps FredoPortrait can accomplish this for you?
Create a 2d component from selection/view?
C

1 Like