what is the fastest way to convert point to edges in python?
the current implementation to convert it is by checking all the prims if it has the same point component
but this is very slow… on a large mesh
thanx before
Patar
fastest way to convert point to edges in python
4679 16 2- patar
- Member
- 280 posts
- Joined:
- Offline
- EsadMusiic
- Member
- 8 posts
- Joined: Aug. 2017
- Offline
- patar
- Member
- 280 posts
- Joined:
- Offline
- Olaf Finkbeiner
- Member
- 323 posts
- Joined: Jan. 2015
- Online
Hi Patar,
you can define functions in vex:
see:
http://www.sidefx.com/docs/houdini/vex/cookbook [www.sidefx.com]
Olaf
you can define functions in vex:
see:
http://www.sidefx.com/docs/houdini/vex/cookbook [www.sidefx.com]
Olaf
- patar
- Member
- 280 posts
- Joined:
- Offline
hmmm thanx… i rarely see function in vex so i assume it only support linear way of programming kinda like expression
so thanks for this!!
but do you have the answer to the main question?
it turn out to manipulate edge in vex is a little harder in vex..
best regards
Patar
so thanks for this!!
but do you have the answer to the main question?
it turn out to manipulate edge in vex is a little harder in vex..
best regards
Patar
Edited by patar - Aug. 31, 2017 06:35:48
- Olaf Finkbeiner
- Member
- 323 posts
- Joined: Jan. 2015
- Online
- patar
- Member
- 280 posts
- Joined:
- Offline
actually what im looking for is a faster way to do Procedural Edge Loops
like what Luiz Kruel does in :
https://sidefx.com/tutorials/houdini-game-dev-tools-procedural-edge-loopsgroup-expandcontract/ [sidefx.com]
i found that this asset is very slow im trying to find a faster way
thats the main goal
but before that i have to know how to convert points to edges, and contained edges, prims, and contained prims…
its like group promote sops but in python…
best regards
Patar
like what Luiz Kruel does in :
https://sidefx.com/tutorials/houdini-game-dev-tools-procedural-edge-loopsgroup-expandcontract/ [sidefx.com]
i found that this asset is very slow im trying to find a faster way
thats the main goal
but before that i have to know how to convert points to edges, and contained edges, prims, and contained prims…
its like group promote sops but in python…
best regards
Patar
- Olaf Finkbeiner
- Member
- 323 posts
- Joined: Jan. 2015
- Online
Hi Patar,
maybe have a look at the tool from Luiz.
It is actually written in Python!
I think a vex version of it might and should be faster.
And it is actualy not a trivial task.
The tool Luiz wrote seems only to work on quad meshes with loops presnt, if you feed it a trimesh it does not realy work…
You may want to have a look at
https://github.com/qLab/qLib [github.com]
there is -group edge loop ql" does what i was expecting and is fast… I have not looked how they implemented it.
kind regards
Olaf
maybe have a look at the tool from Luiz.
It is actually written in Python!
I think a vex version of it might and should be faster.
And it is actualy not a trivial task.
The tool Luiz wrote seems only to work on quad meshes with loops presnt, if you feed it a trimesh it does not realy work…
You may want to have a look at
https://github.com/qLab/qLib [github.com]
there is -group edge loop ql" does what i was expecting and is fast… I have not looked how they implemented it.
kind regards
Olaf
- Olaf Finkbeiner
- Member
- 323 posts
- Joined: Jan. 2015
- Online
- patar
- Member
- 280 posts
- Joined:
- Offline
- tamte
- Member
- 8575 posts
- Joined: July 2007
- Offline
- patar
- Member
- 280 posts
- Joined:
- Offline
Thanx tomas,
I can not find the “hou.Geometry.edgeLoop()” in the documentation
also can you give a snippet how to use the selection class to convert components?
im also with olaf ….my python is also rusty hehehe…
thanx again
i love this community!!! its one of the best i've seen anywhere… so helpfull
thanx guys
best regards
Patar
I can not find the “hou.Geometry.edgeLoop()” in the documentation
also can you give a snippet how to use the selection class to convert components?
im also with olaf ….my python is also rusty hehehe…
thanx again
i love this community!!! its one of the best i've seen anywhere… so helpfull
thanx guys
best regards
Patar
- tamte
- Member
- 8575 posts
- Joined: July 2007
- Offline
patar
…
I can not find the “hou.Geometry.edgeLoop()” in the documentation
…
right here
http://sidefx.com/docs/houdini/hom/hou/Geometry#loops [sidefx.com]
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- tamte
- Member
- 8575 posts
- Joined: July 2007
- Offline
patar
…
also can you give a snippet how to use the selection class to convert components?…
quick example of Python SOP to convert point group or pattern to edge group and contained edge group
node = hou.pwd() geo = node.geometry() # specify point group pattern ptgrp = "0 1" # create selection object from ptgrp sel = hou.Selection(geo, hou.geometryType.Points, ptgrp) # convert to edge selection sel.convert(geo, hou.geometryType.Edges) # get edges from selection edges = sel.edges(geo) # keep only contained edges cedges = [] pts = geo.globPoints(ptgrp) for edge in edges: if set(edge.points()).issubset(pts): cedges.append(edge) # create groups if needed grp = geo.createEdgeGroup("neighborEdges") grp.add(edges) grp = geo.createEdgeGroup("containedEdges") grp.add(cedges)
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- patar
- Member
- 280 posts
- Joined:
- Offline
- riviera
- Member
- 1694 posts
- Joined: March 2020
- Offline
Olaf Finkbeiner
Hi Patar,
i just looked into group_edge_loop_ql_SOP.otl
and it is also done in python.
I had a look at the code (my python is rusty) but it seems quite advanced…
It makes use of itertools and is at least a bit documented…
Yeah, I wrote that code before there was any edge loop functionality in the python API. It's quite old, though (although it still might have some relevance, I'm not familiar how extensive the python api functionality is).
The reason why the code looks a bit complicated because I started replacing houdini geometry structures with an own data representation to make it faster (I mention the improvements in the code comments).
cheers,
Imre
Imre Tuske
FX Supervisor | Senior FXTD @ Weta FX
qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
FX Supervisor | Senior FXTD @ Weta FX
qLib -- Houdini asset library
http://qlab.github.io/qLib/ [qlab.github.io]
https://www.facebook.com/qLibHoudini [www.facebook.com]
- Olaf Finkbeiner
- Member
- 323 posts
- Joined: Jan. 2015
- Online
-
- Quick Links