Manifold 1.0
Robust computational 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
34using SimplePolygonIdx = std::vector<PolyVert>;
35using PolygonsIdx = std::vector<SimplePolygonIdx>;
36
37std::vector<ivec3> TriangulateIdx(const PolygonsIdx &polys,
38 double epsilon = -1);
44std::vector<ivec3> Triangulate(const Polygons &polygons, double epsilon = -1);
45
46ExecutionParams &PolygonParams();
48} // namespace manifold
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:999
vec2 pos
X-Y position.
Definition polygon.h:29
int idx
ID or index into another vertex vector.
Definition polygon.h:31
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
Definition polygon.h:27
Definition common.h:22
std::vector< SimplePolygon > Polygons
Definition common.h:105
Definition common.h:561
Definition iters.h:22