how creat a tansparent polyhedra

Asked by lip

hello
i want to creat a transparent polyhedra, only the edge of the polyhedra will be visible, how can i do that?
i would appreciate if you can help me

Question information

Language:
English Edit question
Status:
Answered
For:
Yade Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Jérôme Duriez (jduriez) said :
#1

Hi,

Like for any other shape:

b.shape.wire = True # where b is your YADE body

Revision history for this message
Jan Stránský (honzik) said :
#2

Hi,

Next time, please be more specific:
- transparent in Yade GUI? Paraview?
- haw do you create your polyhedrons? a MWE with one polyhedron displaying it would be nice..

Assuming Yade GUI: transparency is controlled by body.shape.wire attribute. Set it to True to see "wireframe".
It is not only edges, but also triangulation of more-than-tree-vertex faces.

some functions accepts wire argument (like utils.polyhedron), some not (like those in polyhedra_utils module)

###
from yade import polyhedra_utils, qt
mat = defaultMaterial()
p1 = polyhedra_utils.polyhedra(mat) # no parameter 'wire'
#p1.wire = ... must be set "manually"
p2 = utils.polyhedron(((0,0,0),(1,0,0),(0,1,0),(1,1,0),(0,0,1)),wire=True) # you can set wire at creation
O.bodies.append((p1,p2))
qt.View()
# uncomment to "flip" transparency
#p1.shape.wire = True
#p2.shape.wire = False
###

cheers
Jan

Can you help with this problem?

Provide an answer of your own, or ask lip for more information if necessary.

To post a message you must log in.