Evaulating solid geometry

Have jReality programming problems or questions? Post them here.
Post Reply
DoZ
Posts: 1
Joined: Mon 4. Jun 2012, 23:12

Evaulating solid geometry

Post by DoZ » Mon 4. Jun 2012, 23:18

I hope this is not a stupid question but...

I want to be able to import geometry (in this case STL) and then for any X and Y coordinate I need to find the Z

I have created teh GUI and inported the STIL file fine. I have also looked at the thread below which shows me how to get a point via pick but I need to evaulate potentially thousands or points over the "surface" and want to to it programatically.

http://www3.math.tu-berlin.de/jreality/ ... inate#p927

Any help is greatly appreciated.

DoZ

User avatar
gunn
Posts: 323
Joined: Thu 14. Dec 2006, 09:56
Location: TU Berlin
Contact:

Re: Evaulating solid geometry

Post by gunn » Tue 5. Jun 2012, 21:03

What if there are several pieces of geometry with the same (x,y) coordinates but different z? Do you want only the "first" one? Then you'll also need to define what you mean by "first".

Or you can get a whole list. Look at the class de.jreality.scene.pick.AABBPickSystem. It can be used to calculate such a list of hits. Use the method setSceneRoot(SceneGraphComponent root) to set the scene graph you want to pick; then call computePick(double[] from, double[] to), which returns a list of the hit points along the ray beginning at the point "from" and going in the direction of "to". The class de.jreality.tools.ShipNavigationTool uses this method, as does de.jreality.toolsystem.ToolSystem, you can look there to see how it's used.

Good luck!
jReality core developer

Post Reply