Vector output of idlgrpolygon models [message #78273] |
Tue, 08 November 2011 06:22  |
D D
Messages: 6 Registered: November 2011
|
Junior Member |
|
|
Hi,
For a large document I'm currently writing I have the need to make
several 3D diagrams. As my drawing skills aren't up to much I thought
why not use IDL to generate the models programmatically, draw them in
3d and then save them to a postscript file or similar.
[For the question without context skip to >>>>>> below!]
The first part was fine and I generated some nice object graphics
based models. Then came the problem, how do I save these in a vector
format?
I played around with the idlgrclipboard and idlgrprinter objects.
Using the printer object idlgrprinter I can produce vector files but
only in black and white (i'm on unix based machines so IDL uses the
xprinter system) and i'm not sure how to add another printer to do
this in colour. I found that I could make colour vector files easily
with idlgrclipboard however this is suboptimal. The vector files
produced draw ALL polygons whether they are visible from the current
view or not. This results in rather large postscript files meaning I
can't use them as my final document would be too large.
Finally at work I've got access to idl v8.0, this brings the idlgrpdf
output object so I thought i'd give that a go. This looked like my
solution as the vector pdf's produced are small in size and full
colour. Unfortunately there appear to be several polygons missing in
the output, looking carefully it appears that for a few points
polygons in the background are being drawn on top of the foreground
polys.
It looks like postscript output via idlgrclipboard is my best bet if I
can turn off polygons that aren't seen. I guess this reduces to a
problem of vector plane intersection (albeit in a rather large loop)
where I toggle the HIDE property based on number of intersections > 0
>>>> >>>>>>>>>> So here's my question:
Is there a simple way to get idl to remove/hide all polygons which
can't be seen in the current view? I realise with modern hardware this
is often not time efficient (i.e. takes longer to check if a poly can
be seen then it does to just draw it anyway) so may not be built in
but in my case (writing to a file) the one off cost of checking for
hidden polygons is worth it for significant file size reduction.
Some alternative/intermediate questions:
i) Is there a routine anywhere to check if a polyline/vector
intersects with a polygon object?
ii) Am I missing an obvious solution (which doesn't just save the
figure in a raster format).
iii) A better question may be how to fix the pdf output/is this a
known issue?
iv) In order to draw a polyline to intersect with a polygon I
need two points, one is the point of interest. I guess the second is
the eye position, is this correct? Where is the eye position? What
about the different projection types?
If it helps with context the particular figure I'm working with
involves ten nested toroidal surfaces with varying extent in toroidal
angle. For this region a significant number of polygons can be hidden
from view at a time.
Apologies for the rambling nature of this post, if any clarification
is needed then please let me know.
Many thanks for any help!
|
|
|