How to select Non-Planar Polygons? [SOLVED]

On 07/08/2015 at 01:53, xxxxxxxx wrote:

Hi guys,

I want to select all Non-Planar Polygons like you can do in the attributes>project info(mode)>structure panel. I want to do this with python but cant find anything about this so i'm wondering if this is even possible.

Thanks guys!

On 07/08/2015 at 02:36, xxxxxxxx wrote:

Hello,

this functionality of the "Project Info" mode cannot be access from the outside so you have to rebuild that functionality.

From a given PolygonObject you can access the polygon selection that is stored in a BaseSelect object with GetPolygonS(). Then you can loop trough all polygons returned by GetAllPolygons(), check if a certain polygon is planar or not and select it.

Best wishes,
Sebastian

On 07/08/2015 at 03:41, xxxxxxxx wrote:

Thanks Sebastian,

I already thought that wasn't possible.  :frowning2:

I know how to iterate through the polygons of object and select them. But i don't know how to check if a certain polygon is planar or not. Do i need to do this mathematically?

Greets, 
Gianni

On 07/08/2015 at 08:57, xxxxxxxx wrote:

Hello,

yes, you have to solve this problem mathematically. But since this is a very common task you should be able to find many resource like this one: "Using dot product to determine if point lies on a plane".

Best wishes,
Sebastian

On 10/08/2015 at 01:10, xxxxxxxx wrote:

Thanks Sebastian i have got it working!

found a python script made by pim grooff http://blog.grooff.eu/?p=90 
im checking if the cross corner points lines are intersecting if not its a non planar poly

Greets,
Gianni