- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi ,
I have been trying to use the Outline class in order to figure out if a point is inside a certain outline which I build from the stems from a floor top face . using the Outline.contains(XYZ pt, double Tolerance).
I create the outline with the constructor that uses minimum and maximum points.
It seems to behave like a bounding box rather than how I expected an Outline to behave , when I compile and run the code below (one time with p2 as the Maximum point and the other with p5 ) I get the results as show in the images below.
Is this the planned behaviour ? it's not what I expected at all , the documentation is sparse.
public void squick()
{
XYZ p0, p1, p2, p3, p4, p5, pout , pin;
p0 = new XYZ(0,0,0);
p1 = new XYZ(0,80,0);
p2 = new XYZ(80, 80, 0);
p3 = new XYZ(80, 50, 0);
p4 = new XYZ(50, 50, 0);
p5 = new XYZ(50, 0, 0);
pout= new XYZ(60,30,0);
pin = new XYZ(60,60,0);
Outline outline = new Outline(p0, p5); // alternate p2 and p5
string o, i;
o = outline.Contains(pout, 0.0001) ? "Inside" : "Outside";
i = outline.Contains(pin, 0.0001) ? "Inside" : "Outside";
string r = $"60,30 is {o} and 60,60 is {i}";
// should be 60,30 is outside and 60,60 is inside
TaskDialog.Show("check", r);
}
If I use the top right corner (p2 =80,80,0) as the maximum point it shows both points (60,60 and 60,30) as inside, if I use the bottom right corner (p5 =50,0,0) as the maximum point it shows both points as outside.
BIM Developer
Solved! Go to Solution.