diff --git a/doc/polygonize.md b/doc/polygonize.md deleted file mode 100644 index 423bee8..0000000 --- a/doc/polygonize.md +++ /dev/null @@ -1,107 +0,0 @@ -# polygonize - -`polygonize()` computes the faces of a hipped roof from a footprint polygon of a building, skeletonized by a straight skeleton. It accepts a simple description of the vertices of the footprint polygon, including those of evetual holes, and returns a list of polygon faces. - -The polygon is expected as a list of vertices in counterclockwise order. In a right-handed coordinate system, seen from top, the polygon is on the left of its contour. Holes are expected as lists of vertices in clockwise order. Seen from top, the polygon is on the left of the hole's contour. - -``` -polygonize(verts, firstVertIndex, numVerts, holesInfo=None, height=0.0, tan=0.0, faces=None, unitVectors=None, mergeRange=0.15) -``` -## Arguments -
Argument | -Description | -
---|---|
verts | -
- A list of vertices. Vertices that define the outer contour of the footprint polygon are located in a continuous block of the verts list, starting at the index firstVertIndex . Each vertex is an instance of mathutils.Vector with 3 coordinates x, y and z. The z-coordinate must be the same for all vertices of the polygon.- The outer contour of the footprint polygon contains numVerts vertices in counterclockwise order, in its block in verts .- Vertices that define eventual holes are also located in verts . Every hole takes its continuous block. The start index and the length of every hole block are described by the argument holesInfo . See there.- The list of vertices verts gets extended by polygonize() . The new nodes of the straight skeleton are appended at the end of the list.
- |
-
firstVertIndex | -
- The first index of vertices of the polygon index in the verts list that defines the footprint polygon.
- |
-
numVerts | -
- The first index of the vertices in the verts list of the polygon, that defines the outer contour of the footprint.
- |
-
holesInfo | -
- If the footprint polygon contains holes, their position and length in the verts list are described by this argument. holesInfo is a list of tuples, one for every hole. The first element in every tuple is the start index of the hole's vertices in verts and the second element is the number of its vertices.- The default value of holesInfo is None , which means that there are no holes.
- |
-
height | -
- The maximum height of the hipped roof to be generated. If both height and tan are equal to zero, flat faces are generated. height takes precedence over tan if both have a non-zero value. The default value of height is 0.0.
- |
-
tan | -
- In many cases it's desirable to deal with the roof pitch angle instead of the maximum roof height. The tangent tan of the roof pitch angle can be supplied for that case. If both height and tan are equal to zero, flat faces are generated. height takes precedence over tan if both have a non-zero value. The default value of tan is 0.0.
- |
-
faces | -
- An already existing Python list of faces. Everey face in this list is itself a list of indices of the face-vertices in the verts list. If this argument is None (its default value), a new list with the new faces created by the straight skeleton is created and returned by polygonize(), else faces is extended by the new list.
- |
-
unitVectors | -
- A Python list of unit vectors along the polygon edges (including holes if they are present). These vectors are of type mathutils.Vector with three dimensions. The direction of the vectors corresponds to order of the vertices in the polygon and its holes. The order of the unit vectors in the unitVectors list corresponds to the order of vertices in the input Python list verts .- The list unitVectors (if given) gets used inside polygonize() function instead of calculating it once more. If this argument is None (its default value), the unit vectors get calculated inside polygonize() .
- |
-
mergeRange | -
- skeletonize() sometimes produces clusters of vertices that are close together. These get merged into one vertice, for all pairs of vertices, that are within a square of width mergeRange and where the Manhattan distance between such pairs is less than 5*mergeRange . The default value of mergeRange is 0.15.
- |
-
Value | -Description | -
---|---|
verts | -
- The list of the vertices verts gets extended at its end by the vertices of the straight skeleton.
- |
-
return | -
- A list of the faces created by the straight skeleton. Everey face in this list is a list of indices of the face-vertices in the verts list. The order of vertices of the faces is counterclockwise, as the order of vertices in the input Python list verts . The first edge of a face is always an edge of the polygon or its holes.- If a list of faces has been given in the argument faces , it gets extended at
- its end by the new list.
- |
-
Argument | -Description | -
---|---|
edgeContours | -
- A list of contours of the polygon and eventually its holes, where every contour is a list of edges of type `Edge2` (imported from `bpyeuclid`). It is expected to as: - edgeContours = [ polygon_edge,<hole1_edges>, <hole2_edges>, ...] - polygon_egdes is a list of the edges of the outer polygon contour in counterclockwise order. <hole_edges> is an optional list of the edges of a hole contour in clockwise order.
- |
-
mergeRange | -
- skeletonize() sometimes produces clusters of vertices that are close together. These get merged into one vertice, for all pairs of vertices, that are within a square of width mergeRange and where the Manhattan distance between such pairs is less than 5*mergeRange . The default value of mergeRange is 0.15.
- |
-
Value | -Description | -
---|---|
return | -
- A list of subtrees (of type Subtree ) of the straight skeleton. A Subtree contains the attributes (source, height, sinks) , where source is the node vertex, height is its distance to the nearest polygon edge, and sinks is a list of vertices connected to the node. All vertices are of type mathutils.Vertex with two dimension x and y.
- |
-