Archicad C++ API
About Archicad add-on development using the C++ API.

Use of Geometry::OffsetPolygon2DData() function.

Anonymous
Not applicable
Hi,

I want to use Geometry::OffsetPolygon2DData() function.

The structure of this function is
Geometry::OffsetPolygon2DData(const Polygon2DData& poly, Vector offset, Polygon2Ddata* offsetedPoly);

But, I don’t have offset as the Vector (I have in double (Distance)) to pass to this function.

How do I convert Distance (double) to offset (Vector)?

Can anyone please give me an example how to use Gepmetry::OffsetPolygon2Ddata() function.
1 REPLY 1
Ralph Wessel
Mentor
Ranga wrote:
I want to use Geometry::OffsetPolygon2DData() function.
I don’t have offset as the Vector (I have in double (Distance)) to pass to this function.
How do I convert Distance (double) to offset (Vector)?
I don't use these functions, but it seems straightforward. You can't be moving a polygon by just a distance, there must also be a direction. So convert the distance and angle to a vector (as an x, y, z offset).
Ralph Wessel BArch