.NET
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Extents3d bug?

5 REPLIES 5
Reply
Message 1 of 6
Anonymous
525 Views, 5 Replies

Extents3d bug?

Hi.

I don't get any coordinates for Extents3d MinPoint, the MinPoint always
return 0,0.
I tried to use both AddPoint and AddExtent.

Is this a known bug?

Best regards
Peter
5 REPLIES 5
Message 2 of 6
pavlos.katsonis
in reply to: Anonymous

When you construct an Extents3d object, its MinPoint and MaxPoint are both at (0,0,0). So, when you add extents to it (or points), if these are over and to the right of (0,0,0), the MinPoint remains (0,0,0). You have to refrain from using a constructor for Extents3d. Instead try something like:
if (extents) extents.AddExtent(...)
else extents = ...
Message 3 of 6
Anonymous
in reply to: Anonymous

Thanks Pavlos.

wrote in message news:5563520@discussion.autodesk.com...
When you construct an Extents3d object, its MinPoint and MaxPoint are both
at (0,0,0). So, when you add extents to it (or points), if these are over
and to the right of (0,0,0), the MinPoint remains (0,0,0). You have to
refrain from using a constructor for Extents3d. Instead try something like:
if (extents) extents.AddExtent(...)
else extents = ...
Message 4 of 6
Anonymous
in reply to: Anonymous

No, you don't refrain from using the constructor,
you use the overloaded constructor that takes
two Point3d arguments (min and max point),
which sets the initial extents to those points.

For example, to compute the geometric extents
of a Point3dCollection with at least two elements:

Point3dCollection points = // ....

Extents3d extents = new Extents3d(points[0], points[1]);

for(int i = 2; i < points.Count; i++)
extents.AddPoint(points);


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5563520@discussion.autodesk.com...
When you construct an Extents3d object, its MinPoint and MaxPoint are both at (0,0,0). So, when you add extents to it (or points), if these are over and to the right of (0,0,0), the MinPoint remains (0,0,0). You have to refrain from using a constructor for Extents3d. Instead try something like:
if (extents) extents.AddExtent(...)
else extents = ...
Message 5 of 6
Anonymous
in reply to: Anonymous

Thanks Tony.

If I wasn't sitting on my head I should have been able to figure that out my
self...!

"Tony Tanzillo" wrote in message
news:5563658@discussion.autodesk.com...
No, you don't refrain from using the constructor,
you use the overloaded constructor that takes
two Point3d arguments (min and max point),
which sets the initial extents to those points.

For example, to compute the geometric extents
of a Point3dCollection with at least two elements:

Point3dCollection points = // ....

Extents3d extents = new Extents3d(points[0], points[1]);

for(int i = 2; i < points.Count; i++)
extents.AddPoint(points);


--
http://www.caddzone.com

AcadXTabs: MDI Document Tabs for AutoCAD 2008
Supporting AutoCAD 2000 through 2008
http://www.acadxtabs.com

wrote in message news:5563520@discussion.autodesk.com...
When you construct an Extents3d object, its MinPoint and MaxPoint are both
at (0,0,0). So, when you add extents to it (or points), if these are over
and to the right of (0,0,0), the MinPoint remains (0,0,0). You have to
refrain from using a constructor for Extents3d. Instead try something like:
if (extents) extents.AddExtent(...)
else extents = ...
Message 6 of 6
sieben
in reply to: Anonymous

Extents3d extents = new Extents3d(points[0], points[1]);
it should extents.MinPoint=points[0],extents.MaxPoint=points[1],but not extents.MinPoint=(0,0,0),extents.MaxPoint=(0,0,0),
the same as extents= new Extents3d((0,0,0),(0,0,0));
it must
Extents3d extents = new Extents3d(points[0], points[1]);
extents.Set(points[0], points[1]) >>>> extents.MinPoint=points[0],extents.MaxPoint=points[1];
the Extents3d(Point3d,Point3d) constructor should be bug!!!

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk DevCon in Munich May 28-29th


Autodesk Design & Make Report

”Boost