Thanks, @khameeteman
could please show me an example?
And what about points using trimesh?
I am asking for an example because I never used trimesh and they have a different why of building elements, I have to provide entitiesโฆ
So an example could help
Yeah, I saw that example and it is clear.
Iโm trying to understand the requirements for a Path2d and Path3d trimesh.path โ trimesh 3.12.6 documentation
what are entities and how I should pass the vertices?
This is what I asked for an example.
I understand, it is not as straightforward and I noticed that you will also need shapely and scipy as separate requirements while they are not actually necessary for this part of the trimesh code. So I can imagine that simply passing a viktor line should be much easier. I will bump our internal issue.
Anyway, this should work:
@GeometryView(...)
def geometry_view(self, **kwargs):
import trimesh
p1 = [0, 0, 0]
p2 = [1, 1, 0]
line = trimesh.path.entities.Line(points=[0, 1])
path = trimesh.path.Path3D(entities=[line], vertices=[p1, p2])
scene = trimesh.Scene(geometry=path)
geometry = File()
with geometry.open_binary() as w:
w.write(trimesh.exchange.gltf.export_glb(scene))
return GeometryResult(geometry)
Getting back to this post because some new developments have been shipped. If you bump to SDK v13.5.0 or higher you are able to visualise Line elements as well. The changelog also describes that Arc and PolyLine elements are now ready to be visualised in a GeometryView as well. Point elements can still not be visualised directly, though the option is still open to generate a Sphere to include points in a visual.