Hello there,

Is there a way in CGA code to check if a 2D scope contains any acute angles? The reason I ask is that I don't want to generate a building on any lots with acute angles (generate a Park instead maybe). I can check for 3 sided lots and rule them out, but it doesn't help with cases like this . . .

. . . .where there are 4 verts and 4 'sides' even though 2 of the sides are co-incident. Checking for an acute angle would solve this, as there are 2 acute internal angles. This strikes me as quite a basic thing to want to check for, before generating a building.

Any help appreciated.

Sean

Hi Sean,

to solve your task, please use the

geometry.isRectangular(geometry Functions) function.## Synopsis

bool geometry.isRectangular(float tolerance)

## Parameters

The tolerance in degrees for deciding if an angle is a right one or not.

## Returns

true if all faces of the current shape's geometry consist of 4 vertices and contain only right angles, false otherwise. Angles in the range [90-tolerance, 90+tolerance] are considered to be "right".