Ruby Nuby - Origins and XYZ export
-
Background:
I use SU to lay out features and models on terrain imported from GE.
Most of the features are on the terrain surface and I need to transfer these into a Mathlab clone (Scilab) as xyz arrays. Some of it I want to automate with a Ruby script, some I do as direct measurements.Pretty simple, and I'm well on the way to "my" first Ruby, with code stolen from all over, especially weld.rb. But the SU XYZ is based on the World Origin, and I have an origins issue.
GE terrain imports with the World Origin near the centre of the terrain, but for my purposes, it is preferable to have the origin close to one of the corners.
That way, the Scilab modelling output graphics are easier for my clients to understand (no +ve/-ve numbers). When doing it manually, I change the axes to an appropriate location and set a datum plane, and read off XYZ using the tape tool.
What I'd like to do is relate the XYZ to these changed axes. Three methods occur to me
-
I can solve it with post processing, and that works fine, but means i need to do a bit of set up (I'm thinking of adding a "choose Origin" dialog to perform this, but its less clean than 2 & 3)
-
If I can source the XYZ of the current axes origin, then the solution is a simple transformation (I don't think Current Origin point is available - I've been searching all over the forums and API)
-
If I can import GE terrain with another origin point specified, then my current Ruby script works. But I'm pretty sure this can't be done.
I'm proceeding with 1), but would appreciate any suggestions or insights.
Thanks in advance. -
Advertisement