POV-Ray : Newsgroups : povray.binaries.utilities : postscript/pdf to POVRay prism : Re: postscript/pdf to POVRay prism Server Time
30 Apr 2024 01:00:22 EDT (-0400)
  Re: postscript/pdf to POVRay prism  
From: Ross Martin
Date: 19 Mar 2003 17:19:43
Message: <3E78ECC8.3040704@ross.interwrx.com>
I see what you're trying to do now.  You have stuff behind the text,
so you want a non-transparent black area surrounding the text to make
the text more visible by blocking view of this other stuff.

It could certainly be done in some way similar to that you describe.
I did something a little similar in order to get stroked paths with
finite widths to work in my conversion.  These must be converted into
prisms, so I have to move the points on the line in either direction
to give the desired width and make a prism out of the result.  I don't
need this, but you are certainly welcome to modify the code to do it.

It could also be done (less efficiently) by taking the text, moving it
back slightly, making it black, and then taking the CSG union of it
being moved slightly in different directions.  If you take enough
different directions, it would have the effect of enlarging the text
into a background for the text as you describe.

Ross


Mark Weyer wrote:
>> 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?
> 
>


Post a reply to this message

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