Manifold 3.0
Robust geometry
 
Loading...
Searching...
No Matches
polygon.h
1// Copyright 2021 The Manifold Authors.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16#include "manifold/common.h"
17
18namespace manifold {
19
27struct PolyVert {
31 int idx;
32};
33
39using SimplePolygonIdx = std::vector<PolyVert>;
40
47using PolygonsIdx = std::vector<SimplePolygonIdx>;
55std::vector<ivec3> TriangulateIdx(const PolygonsIdx &polys,
56 double epsilon = -1);
57
58std::vector<ivec3> Triangulate(const Polygons &polygons, double epsilon = -1);
59
60ExecutionParams &PolygonParams();
62} // namespace manifold
Global parameters that control debugging output. Only has an effect when compiled with the MANIFOLD_D...
Definition common.h:576
vec2 pos
X-Y position.
Definition polygon.h:29
int idx
ID or index into another vertex vector.
Definition polygon.h:31
std::vector< SimplePolygon > Polygons
Set of polygons with holes. Order of contours is arbitrary. Can contain any depth of nested holes and...
Definition common.h:139
std::vector< SimplePolygonIdx > PolygonsIdx
Set of indexed polygons with holes. Order of contours is arbitrary. Can contain any depth of nested h...
Definition polygon.h:47
std::vector< PolyVert > SimplePolygonIdx
Single polygon contour, wound CCW, with indices. First and last point are implicitly connected....
Definition polygon.h:39
Polygon vertex.
Definition polygon.h:27
std::vector< ivec3 > Triangulate(const Polygons &polygons, double epsilon=-1)
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap,...
Definition polygon.cpp:995
std::vector< ivec3 > TriangulateIdx(const PolygonsIdx &polys, double epsilon=-1)
Triangulates a set of ε-valid polygons. If the input is not ε-valid, the triangulation may overlap,...
Definition polygon.cpp:950