POV-Ray : Newsgroups : povray.binaries.utilities : postscript/pdf to POVRay prism : Re: postscript/pdf to POVRay prism Server Time
29 Apr 2024 21:44:01 EDT (-0400)
  Re: postscript/pdf to POVRay prism  
From: Mark Weyer
Date: 19 Mar 2003 06:02:09
Message: <3E78515A.2000907@informatik.uni-freiburg.de>
> First, a "prism" is a generalization of a polygon that allows
> curves (not just straight sides) and is extruded into the third
> dimension.  So I think this is what you want when you say you want
> a "polygon".

My mistake. I assumed polygons could have the same spline types as prisms.
Now I would approximate polygons by thin prisms.

> Second, I'm not sure what you mean by an "outline".

I will shortly post an example in p.b.i

 > You mean you
> add something surrounding the text?  If it is just straight lines,

Yes. No. I want it to follow the line type of the text. If the text
uses a straight line, the outline should also. If the text uses a
curve, the outline should also. It should be the same prism with
everything moved "outwards" by some constant.

> The code I made only converts objects that are actually drawn in the
> postscript.  There is no way to add hints for how the object dimensions
> should affect placement of other objects.  Perhaps something like this
> could be added and might be a good idea.  Perhaps not.  I'd have to
> think about it.  Don't expect anything soon.

Assumption: It is determinable whether the polygon points are aranged
clockwise or counter-clockwise.

Now if we know the former, i.e. the polygon is always to our right hand
side as we walk around it, I would suggest the following:
For every polygon point determine the directions of the two curves that
meet there. Calculate the intermediate direction (choose the one to the
left). Displace the polygon point by the outline distance in that
direction.

How can we establish the assumption? Let us first consider the case
that all shapes are simply connected (have no holes). Then take two
neighboured polygon points, and move from one halfway to the other
and then just a tiny bit to the right. From that point calculate the
polygon's winding number. If it is zero, then you are outside of the
polygon, so it runs counterclockwise.
Now for not simply connected shapes. What I could read from your code
suggests that those are presented as a difference of a simply connected
one and a union of simply connected one. Then it is easy again.

Have you looked at the ps2edit source code?


-- 
merge{#local i=-11;#while(i<11)#local
i=i+.1;sphere{<i*(i*i*(.05-i*i*(4e-7*i*i+3e-4))-3)10*sin(i)30>.5}#end
pigment{rgbt 1}interior{media{emission x}}hollow}//  Mark Weyer


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.