yade-users team mailing list archive
-
yade-users team
-
Mailing list archive
-
Message #21690
Re: [Question #688040]: dimensions of an imported body
Question #688040 on Yade changed:
https://answers.launchpad.net/yade/+question/688040
Status: Open => Answered
Jan Stránský proposed the following answer:
imported body is a list of facets. You have access to its data, so you can do whatever you want. For example to get the min and max x coordinate:
###
minX = 1e99, maxX = -1e99
for facet in facets:
vs = [facet.state.pos + facet.state.ori * v for v in facet.shape.vertices] # vertices in global coord system
minX = min(minX,min(v[0] for v in vs))
maxX = max(maxX,max(v[0] for v in vs))
###
you can of course compute min and max y and z coordinates the same way
or do more sophisticated analysis (smallest enclosing ellipsoid for
instance).
cheers
Jan
--
You received this question notification because your team yade-users is
an answer contact for Yade.