vinz

Need Help for Generating a Fan-shaped Buffer

Discussion created by vinz on Feb 7, 2011
Latest reply on Feb 11, 2011 by vinz
I want to create a fan-shaped buffer using a point with a given orientation and a radius r, just like this:



I've come up with an idea already, but it's quite complicate and I'm wondering if there are any better ways to do it.

My idea is to do the following steps:



1. use point p and radius r to generate a circle buffer. (I drew r wrong in the fig. it should be the radius of the circle. poor drawing. I know..)

2. draw a triangle of which the vertex is p and the perpendicular is pointing in my desired direction.

3. do an intersect operation between the circle and the triangle.

The problem is that I really don't have a clue about how to generate the triangle I want. How should  make the angle P = 2?? ?

Really appreciated if some one could help me with this with some demo codes in C++/C#.:D

Outcomes