Author Topic: Custom preview for the simulation geometry  (Read 326 times)

Xylotica

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 262
    • View Profile
    • Xylotica
Custom preview for the simulation geometry
« on: April 01, 2022, 08:06:22 PM »
I'd like more control over the aspect of the simulation geometry.
In particular, I'd like the meshes to display transparent.
Sadly, Rhino ignores the transparency settings of the wiewports display mode for the standard KUKA|prc display.
So I tried to do my own custom preview, using data from the "GEO" output of the Main KUKA|prc component, and adding a transparency value.
There are three branches in the "GEO" output :
-One for the meshes,
-One for the colors (which has the same list length as the meshes)
-One for the trajectories (curves)

I can't find the logic of distribution for the colors...

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1311
    • View Profile
    • Robots in Architecture
Re: Custom preview for the simulation geometry
« Reply #1 on: April 04, 2022, 09:14:18 AM »
Hello,

If you want a transparent robot, just create a custom robot with custom materials.
Please check the example attached, if that works I can provide you with the meshes and data for yours.
The order of meshes and colors is affected by multithreading, whatever thread is fastest outputs the mesh first. If I need that value in a particular order I usually sort by number of vertices or something like that.

Best,
Johannes

Xylotica

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 262
    • View Profile
    • Xylotica
Re: Custom preview for the simulation geometry
« Reply #2 on: April 04, 2022, 12:13:27 PM »
Quote
If you want a transparent robot, just create a custom robot with custom materials.
Actually, it's more important to me to have a transparent Turntable because I also reference the stock material and I'd like to see the trajectories inside it.

Quote
The order of meshes and colors is affected by multithreading, whatever thread is fastest outputs the mesh first. If I need that value in a particular order I usually sort by number of vertices or something like that.
Hmm... that doesn't really answer my question. The problem is that, in the "GEO" output, the list of colors has the same length as the list of meshes, so I suppose there is some kind of "pairing" intended.
But what are we to do with these lists if the items are shuffled ?
Moreover, there seems to be no colors for the trajectories (polylines)...

Ideally, there would be :
-A list of meshes
-A list of colors corresponding item-by-item to the list of meshes
-A list of curves
-A list of colors corresponding item-by-item to the list of curves

Regarding only transparency, it could also be a simple slider-option in the KUKA-prc main component  : Transparency for meshes 0 -> 255
« Last Edit: April 04, 2022, 12:29:08 PM by Xylotica »

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1311
    • View Profile
    • Robots in Architecture
Re: Custom preview for the simulation geometry
« Reply #3 on: April 05, 2022, 01:39:01 AM »
Hello,

The order of colors should correspond with the meshes!
For the turntable an easy fix would be just create a "mesh wireframe".
So duplicate some edges and in GH use Multipipe followed by Mesh from SubD to get an outline with low resolution for high performance.
Then you can create your turntable with that geometry. I usually try to keep individual meshes <5000 faces.

Best,
Johannes

Xylotica

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 262
    • View Profile
    • Xylotica
Re: Custom preview for the simulation geometry
« Reply #4 on: April 05, 2022, 01:48:04 PM »
Quote
The order of colors should correspond with the meshes!
That seems to be the case indeed, but then could you please expose the line colors ?
The color changes at each frame because the path already done is in dark grey while the remaining path is light grey.
Without this data, all I can do is apply a single color to all the curves, thus losing important visual cue.

Quote
For the turntable an easy fix would be just create a "mesh wireframe".
Thanks but I'm afraid this would be a bit messy ; I prefer transparency.

I think it would be very nice to just have a "Simulation mesh transparency" option.


Xylotica

  • Robots in Architecture Members
  • Forum User
  • *
  • Posts: 262
    • View Profile
    • Xylotica
Re: Custom preview for the simulation geometry
« Reply #5 on: April 05, 2022, 02:11:47 PM »
OK, I just realized the logic of the curve list :
-Item 0 is the path that has been done
-Item 1 is the remaining path
-Item 2,3 and 4 are some kind of frame on the TCP, but which isn't really the TCP

Anyway, once this is figured out, it becomes very easy to color the paths and re-orient and define tool X, Y and Z to one's preference.
See attached.

I guess my question wasn't well formulated from the beginning...
« Last Edit: April 05, 2022, 02:20:22 PM by Xylotica »

Johannes @ Robots in Architecture

  • Lead Developer
  • Administrator
  • Forum User
  • *****
  • Posts: 1311
    • View Profile
    • Robots in Architecture
Re: Custom preview for the simulation geometry
« Reply #6 on: April 05, 2022, 07:45:02 PM »
Hello,

The challenge with transparency is that I had a lot of problems with the order of transparency.
For example, the geometry from the robotic cell component is always transparent, and it needs to be drawn in a certain order because otherwise the opaque geometry behind it might still be hidden (even if the geometry in front is supposed to be transparent).
What I'll do in a subsequent update will be to take the the vertex color of an external axis into account, like for the Custom Robot.

Currently I barely have time to get anything done, but I'll try to have it implemented soon.

Best,
Johannes