How to distinguish flat surface from not flat surface

This widget could not be displayed.

How to distinguish flat surface from not flat surface

Anonymous
Not applicable

How to determine when surfase is a flat surface. Look to attachment .
In autoCAD exist any properties or way how determine when selected surface is a flat surface.

 

Flat surface:
flat surface.png

 

Not flat surface:

surface.png

0 Likes
Reply
419 Views
1 Reply
Reply (1)

Kent1Cooper
Consultant
Consultant

@Anonymous wrote:

How to determine when surfase is a flat surface. ....


For object types that qualify in the "curve" class [perhaps not your images]:

 

(vl-load-com); if needed

(vlax-curve-isPlanar (car (entsel)))

 

Then pick something -- returns T if it's flat, nil if it's not.

 

For other kinds of things, if one is flat and lies in or parallel to the WCS construction plane, you could get its bounding box and compare the Z coordinates of the corners -- if they're the same, it's flat.  The same could be done for something flat in any orthogonal plane, by comparing different coordinates of the corners.

 

If it's not parallel to an orthogonal plane, and it's something that defines a UCS, a similar approach could be taken, aligning the UCS with it and involving the (trans) function when comparing coordinates.

Kent Cooper, AIA
0 Likes