This project is read-only.

Bounds of object

Feb 26, 2013 at 11:59 AM
I'm sorry for not finding answer for this question, but i couldn't find how to triangulate objects considering bounds (cuts) of one.
Image.
Thank you
Feb 26, 2013 at 12:37 PM
If you want to include the convex hull of the geometry (probably what you mean by bounds?), then use
mesh.Behavior.Convex = true;
which should do the trick (make sure to use the latest changeset, not the Beta 3 dll).
Feb 26, 2013 at 12:47 PM
Im sorry again, but where can i find the latest changeset? I found only beta 3 version on this source.
Feb 26, 2013 at 12:54 PM
Edited Feb 26, 2013 at 12:54 PM
-
Feb 26, 2013 at 1:14 PM
Edited Feb 26, 2013 at 1:15 PM
Go to the "Source Code" tab on the top and then click "Download". You will have to compile the project yourself.

If you want to use the Beta 3 dll, the syntax is
mesh.SetOption(Options.Convex, true);
Feb 26, 2013 at 1:25 PM
wo80 wrote:
Go to the "Source Code" tab on the top and then click "Download". You will have to compile the project yourself.

If you want to use the Beta 3 dll, the syntax is
mesh.SetOption(Options.Convex, true);
I used this code but result is the same. Function Triangulate() doesnt consider holes and bounds.

mesh.behavior.Quality = true;
mesh.behavior.MinAngle = min_tr;
mesh.behavior.MaxArea = tr_shag;
mesh.behavior.Convex = true;
mesh.Triangulate(geometry);
mesh.behavior.Convex = true;

Image
Feb 26, 2013 at 2:33 PM
Ok, now I see what you are trying to do. The "convex" option is exactly what you DON'T want to use.

I think your input geometry isn't setup correctly. Maybe you are skipping the segments completely? Did you have a look at the documentation.

If you can't solve the issue, please show the code where you setup the geometry.
Feb 26, 2013 at 2:52 PM
Yes, I skipped segments. I read the documentation, but didnt understand next items:
1) why are segments need?
2) why arguments of function has integer type, not double? (mesh.AddSegment(int p0,int p1).
Feb 26, 2013 at 3:08 PM
It's alright. I understood how i should use it. Thank you very much
Feb 10, 2014 at 8:44 PM
Hello Volchik, can you explain how you succeed to manage your problem ?
I have a problem similar to yours, I only have a list of point and I create a geometry with it but the triangulation close my "mesh".

Thanks for your help
Feb 11, 2014 at 11:15 AM
Hi, rxra. You should do next:
1) Make points list - var geometry = new InputGeometry(pointlist_track.Count);
2) Add all points of the body:
for (int i = 0; i < pointlist_track.Count - 1; ++i)
{
  geometry.AddPoint(pointlist[i].X, pointlist[i].Y); 
}
3) Add segments(faces, edges of body)
 geometry.AddSegment(i1, i2), where i1 and i2 are the numbers of points. Every point in geometry has a number.
4) For adding holes you should use geometry.AddHole(point.X, point.Y).

Be carefull adding segments and holes. If something will be wrong, you will get an error message.
Sorry for my english.
Feb 11, 2014 at 9:33 PM
hi,

thanks for the answer .... in fact I found the solution ... just a mistake will building the segments .... forgot to close the "path".
thanks again.