wip
jaseg 2021-01-24 18:44:56 +01:00
commit f7b4cc602b
230 zmienionych plików z 25005 dodań i 0 usunięć

1
.gitignore vendored 100644
Wyświetl plik

@ -0,0 +1 @@
build

9
.gitmodules vendored 100644
Wyświetl plik

@ -0,0 +1,9 @@
[submodule "upstream/cpp-base64"]
path = upstream/cpp-base64
url = https://github.com/ReneNyffenegger/cpp-base64
[submodule "upstream/voronoi"]
path = upstream/voronoi
url = https://github.com/JCash/voronoi
[submodule "upstream/poisson-disk-sampling"]
path = upstream/poisson-disk-sampling
url = https://github.com/thinks/poisson-disk-sampling

45
Makefile 100644
Wyświetl plik

@ -0,0 +1,45 @@
CXX := clang
LD := ld
PKG_CONFIG ?= pkg-config
BUILDDIR ?= build
SOURCES := src/svg_color.cpp \
src/svg_doc.cpp \
src/svg_geom.cpp \
src/svg_import_util.cpp \
src/svg_path.cpp \
src/svg_pattern.cpp \
src/vec_core.cpp \
src/vec_grid.cpp
CLIPPER_SOURCES := upstream/clipper-6.4.2/cpp/clipper.cpp upstream/clipper-6.4.2/cpp/cpp_cairo/cairo_clipper.cpp
CLIPPER_INCLUDES := -Iupstream/clipper-6.4.2/cpp -Iupstream/clipper-6.4.2/cpp/cpp_cairo/
VORONOI_INCLUDES := -Iupstream/voronoi/src
POISSON_INCLUDES := -Iupstream/poisson-disk-sampling/thinks/poisson_disk_sampling/
BASE64_INCLUDES := -Iupstream/cpp-base64
INCLUDES := $(CLIPPER_INCLUDES) $(VORONOI_INCLUDES) $(POISSON_INCLUDES) $(BASE64_INCLUDES)
CXXFLAGS := -std=c++2a -g -Wall -Wextra
CXXFLAGS += $(shell $(PKG_CONFIG) --cflags pangocairo pugixml opencv4)
LDFLAGS := -lm -lc -lstdc++
LDFLAGS += $(shell $(PKG_CONFIG) --libs pangocairo pugixml opencv4)
all: $(BUILDDIR)/svg-render
test.gbr test.svg &: render
./render test.svg > test.gbr
$(BUILDDIR)/%.o: %.cpp
@mkdir -p $(dir $@)
$(CXX) -c $(CXXFLAGS) $(CXXFLAGS) $(INCLUDES) -o $@ $^
$(BUILDDIR)/svg-render: $(SOURCES:%.cpp=$(BUILDDIR)/%.o) $(BUILDDIR)/upstream/cpp-base64/base64.o $(CLIPPER_SOURCES:.cpp=.o)
@mkdir -p $(dir $@)
$(CXX) $(CXXFLAGS) $(LDFLAGS) -o $@ $^
.PHONY: clean
clean:
rm -rf $(BUILDDIR)

125
src/svg_color.cpp 100644
Wyświetl plik

@ -0,0 +1,125 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "svg_color.h"
#include <assert.h>
#include <string>
#include <cmath>
using namespace svg_plugin;
using namespace std;
/* Map an SVG fill or stroke definition (color, but may also be a pattern) to a gerber color.
*
* This function handles transparency: Transparent SVG colors are mapped such that no gerber output is generated for
* them.
*/
enum gerber_color svg_plugin::svg_color_to_gerber(string color, string opacity, enum gerber_color default_val) {
float alpha = 1.0;
if (!opacity.empty() && opacity[0] != '\0') {
char *endptr = nullptr;
alpha = strtof(opacity.data(), &endptr);
assert(endptr);
assert(*endptr == '\0');
}
if (alpha < 0.5f) {
return GRB_NONE;
}
if (color.empty()) {
return default_val;
}
if (color == "none") {
return GRB_NONE;
}
if (color.rfind("url(#", 0) != string::npos) {
return GRB_PATTERN_FILL;
}
if (color.length() == 7 && color[0] == '#') {
HSVColor hsv(color);
if (hsv.v >= 0.5) {
return GRB_CLEAR;
}
}
return GRB_DARK;
}
svg_plugin::RGBColor::RGBColor(string hex) {
assert(hex[0] == '#');
char *endptr = nullptr;
const char *c = hex.data();
int rgb = strtol(c + 1, &endptr, 16);
assert(endptr);
assert(endptr == c + 7);
assert(*endptr == '\0');
r = ((rgb >> 16) & 0xff) / 255.0f;
g = ((rgb >> 8) & 0xff) / 255.0f;
b = ((rgb >> 0) & 0xff) / 255.0f;
};
svg_plugin::HSVColor::HSVColor(const RGBColor &color) {
float xmax = fmax(color.r, fmax(color.g, color.b));
float xmin = fmin(color.r, fmin(color.g, color.b));
float c = xmax - xmin;
v = xmax;
if (c == 0)
h = 0;
else if (v == color.r)
h = 1/3 * (0 + (color.g - color.b) / c);
else if (v == color.g)
h = 1/3 * (2 + (color.b - color.r) / c);
else // v == color.b
h = 1/3 * (4 + (color.r - color.g) / c);
s = (v == 0) ? 0 : (c/v);
}
/* Invert gerber color */
enum gerber_color svg_plugin::gerber_color_invert(enum gerber_color color) {
switch (color) {
case GRB_CLEAR: return GRB_DARK;
case GRB_DARK: return GRB_CLEAR;
default: return color; /* none, pattern */
}
}
/* Read node's fill attribute and convert it to a gerber color */
enum gerber_color svg_plugin::gerber_fill_color(const pugi::xml_node &node) {
return svg_color_to_gerber(node.attribute("fill").value(), node.attribute("fill-opacity").value(), GRB_DARK);
}
/* Read node's stroke attribute and convert it to a gerber color */
enum gerber_color svg_plugin::gerber_stroke_color(const pugi::xml_node &node) {
return svg_color_to_gerber(node.attribute("stroke").value(), node.attribute("stroke-opacity").value(), GRB_NONE);
}

59
src/svg_color.h 100644
Wyświetl plik

@ -0,0 +1,59 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SVG_COLOR_H
#define SVG_COLOR_H
#include <pugixml.hpp>
namespace svg_plugin {
/* Enum that describes the color with which an SVG primite should be exported */
enum gerber_color {
GRB_NONE = 0,
GRB_CLEAR,
GRB_DARK,
GRB_PATTERN_FILL,
};
class RGBColor {
public:
float r, g, b;
RGBColor(std::string hex);
};
class HSVColor {
public:
float h, s, v;
HSVColor(const RGBColor &color);
};
enum gerber_color svg_color_to_gerber(std::string color, std::string opacity, enum gerber_color default_val);
enum gerber_color gerber_color_invert(enum gerber_color color);
enum gerber_color gerber_fill_color(const pugi::xml_node &node);
enum gerber_color gerber_stroke_color(const pugi::xml_node &node);
} /* namespace svg_plugin */
#endif /* SVG_COLOR_H */

462
src/svg_doc.cpp 100644
Wyświetl plik

@ -0,0 +1,462 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "svg_import_defs.h"
#include "svg_doc.h"
#include "svg_color.h"
#include "svg_geom.h"
#include "svg_path.h"
#include "vec_core.h"
using namespace svg_plugin;
using namespace std;
using namespace ClipperLib;
using namespace vectorizer;
svg_plugin::SVGDocument::~SVGDocument() {
if (cr)
cairo_destroy (cr);
if (surface)
cairo_surface_destroy (surface);
}
bool svg_plugin::SVGDocument::load(string filename, string debug_out_filename) {
/* Load XML document */
auto res = svg_doc.load_file(filename.c_str());
if (!res) {
cerr << "Cannot open input file \"" << filename << "\": " << res << endl;
return false;
}
root_elem = svg_doc.child("svg");
if (!root_elem) {
cerr << "Cannot load input file \"" << filename << endl;
return false;
}
/* Set up the document's viewport transform */
istringstream vb_stream(root_elem.attribute("viewBox").value());
vb_stream >> vb_x >> vb_y >> vb_w >> vb_h;
cerr << "loaded viewbox: " << vb_x << ", " << vb_y << ", " << vb_w << ", " << vb_h << endl;
page_w = usvg_double_attr(root_elem, "width");
page_h = usvg_double_attr(root_elem, "height");
/* usvg resolves all units, but instead of outputting some reasonable absolute length like mm, it converts
* everything to px, which depends on usvg's DPI setting (--dpi).
*/
page_w_mm = page_w / assumed_usvg_dpi * 25.4;
page_h_mm = page_h / assumed_usvg_dpi * 25.4;
if (!(page_w_mm > 0.0 && page_h_mm > 0.0 && page_w_mm < 10e3 && page_h_mm < 10e3)) {
cerr << "Warning: Page has zero or negative size, or is larger than 10 x 10 meters! Parsed size: " << page_w << " x " << page_h << " millimeter" << endl;
}
if (fabs((vb_w / page_w) / (vb_h / page_h) - 1.0) > 0.001) {
cerr << "Warning: Document has different document unit scale in x and y direction! Output will likely be garbage!" << endl;
}
/* Get the one document defs element */
defs_node = root_elem.child("defs");
if (!defs_node) {
cerr << "Warning: Input file is missing <defs> node" << endl;
}
setup_debug_output(debug_out_filename);
setup_viewport_clip();
load_clips();
load_patterns();
_valid = true;
return true;
}
const Paths *svg_plugin::SVGDocument::lookup_clip_path(const pugi::xml_node &node) {
string id(usvg_id_url(node.attribute("clip-path").value()));
if (id.empty() || !clip_path_map.contains(id)) {
return nullptr;
}
return &clip_path_map[id];
}
Pattern *svg_plugin::SVGDocument::lookup_pattern(const string id) {
if (id.empty() || !pattern_map.contains(id)) {
return nullptr;
}
return &pattern_map[id];
};
/* Used to convert mm values from configuration such as the minimum feature size into document units. */
double svg_plugin::SVGDocument::mm_to_doc_units(double mm) const {
return mm * (vb_w / page_w_mm);
}
double svg_plugin::SVGDocument::doc_units_to_mm(double px) const {
return px / (vb_w / page_w_mm);
}
/* Recursively export all SVG elements in the given group. */
void svg_plugin::SVGDocument::export_svg_group(const pugi::xml_node &group, Paths &parent_clip_path) {
/* Enter the group's coordinate system */
cairo_save(cr);
apply_cairo_transform_from_svg(cr, group.attribute("transform").value());
/* Fetch clip path from global registry and transform it into document coordinates. */
Paths clip_path;
auto *lookup = lookup_clip_path(group);
if (!lookup) {
string id(usvg_id_url(group.attribute("clip-path").value()));
if (!id.empty()) {
cerr << "Warning: Cannot find clip path with ID \"" << group.attribute("clip-path").value() << "\" for group \"" << group.attribute("id").value() << "\"." << endl;
}
} else {
clip_path = *lookup;
}
transform_paths(cr, clip_path);
/* Clip against parent's clip path (both are now in document coordinates) */
if (!parent_clip_path.empty()) {
if (!clip_path.empty()) {
cerr << "Combining clip paths" << endl;
combine_clip_paths(parent_clip_path, clip_path, clip_path);
} else {
cerr << "using parent clip path" << endl;
clip_path = parent_clip_path;
}
}
ClipperLib::Clipper c2;
c2.AddPaths(clip_path, ptSubject, /* closed */ true);
ClipperLib::IntRect bbox = c2.GetBounds();
cerr << "clip path is now: bbox={" << bbox.left << ", " << bbox.top << "} - {" << bbox.right << ", " << bbox.bottom << "}" << endl;
/* Iterate over the group's children, exporting them one by one. */
for (const auto &node : group.children()) {
string name(node.name());
if (name == "g") {
export_svg_group(node, clip_path);
} else if (name == "path") {
export_svg_path(node, clip_path);
} else if (name == "image") {
double min_feature_size_mm = 0.1; /* TODO make configurable */
double min_feature_size_px = mm_to_doc_units(min_feature_size_mm);
vectorize_image(cr, node, min_feature_size_px, clip_path, viewport_matrix);
} else if (name == "defs") {
/* ignore */
} else {
cerr << " Unexpected child: <" << node.name() << ">" << endl;
}
}
cairo_restore(cr);
}
/* Export an SVG path element to gerber. Apply patterns and clip on the fly. */
void svg_plugin::SVGDocument::export_svg_path(const pugi::xml_node &node, Paths &clip_path) {
enum gerber_color fill_color = gerber_fill_color(node);
enum gerber_color stroke_color = gerber_stroke_color(node);
double stroke_width = usvg_double_attr(node, "stroke-width", /* default */ 1.0);
assert(stroke_width > 0.0);
enum ClipperLib::EndType end_type = clipper_end_type(node);
enum ClipperLib::JoinType join_type = clipper_join_type(node);
vector<double> dasharray;
parse_dasharray(node, dasharray);
/* TODO add stroke-miterlimit */
if (!fill_color && !stroke_color) { /* Ignore "transparent" paths */
return;
}
/* Load path from SVG path data and transform into document units. */
PolyTree ptree;
cairo_save(cr);
apply_cairo_transform_from_svg(cr, node.attribute("transform").value());
load_svg_path(cr, node, ptree);
cairo_restore (cr);
Paths open_paths, closed_paths;
OpenPathsFromPolyTree(ptree, open_paths);
ClosedPathsFromPolyTree(ptree, closed_paths);
/* Skip filling for transparent fills */
if (fill_color) {
/* Clip paths. Consider all paths closed for filling. */
if (!clip_path.empty()) {
Clipper c;
c.AddPaths(open_paths, ptSubject, /* closed */ false);
c.AddPaths(closed_paths, ptSubject, /* closed */ true);
c.AddPaths(clip_path, ptClip, /* closed */ true);
c.StrictlySimple(true);
/* fill rules are nonzero since both subject and clip have already been normalized by clipper. */
c.Execute(ctIntersection, ptree, pftNonZero, pftNonZero);
}
/* Call out to pattern tiler for pattern fills. The path becomes the clip here. */
if (fill_color == GRB_PATTERN_FILL) {
string fill_pattern_id = usvg_id_url(node.attribute("fill").value());
Pattern *pattern = lookup_pattern(fill_pattern_id);
if (!pattern) {
cerr << "Warning: Fill pattern with id \"" << fill_pattern_id << "\" not found." << endl;
} else {
Paths clip;
PolyTreeToPaths(ptree, clip);
pattern->tile(clip);
}
} else { /* solid fill */
Paths f_polys;
/* Important for gerber spec compliance and also for reliable rendering results irrespective of board house
* and gerber viewer. */
dehole_polytree(ptree, f_polys);
/* Export SVG */
cairo_save(cr);
cairo_set_matrix(cr, &viewport_matrix);
cairo_new_path(cr);
ClipperLib::cairo::clipper_to_cairo(f_polys, cr, CAIRO_PRECISION, ClipperLib::cairo::tNone);
if (fill_color == GRB_DARK) {
cairo_set_source_rgba(cr, 0.0, 0.0, 1.0, dbg_fill_alpha);
} else { /* GRB_CLEAR */
cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, dbg_fill_alpha);
}
cairo_fill (cr);
/* export gerber */
cairo_identity_matrix(cr);
for (const auto &poly : f_polys) {
vector<array<double, 2>> out;
for (const auto &p : poly)
out.push_back(std::array<double, 2>{
((double)p.X) / clipper_scale, ((double)p.Y) / clipper_scale
});
std::cerr << "calling sink" << std::endl;
polygon_sink(out, fill_color == GRB_DARK);
}
cairo_restore(cr);
}
}
if (stroke_color && stroke_width > 0.0) {
ClipperOffset offx;
/* For stroking we have to separately handle open and closed paths */
for (const auto &poly : closed_paths) {
if (poly.empty()) /* do we need this? */
continue;
/* Special case: A closed path becomes a number of open paths when it is dashed. */
if (dasharray.empty()) {
offx.AddPath(poly, join_type, etClosedLine);
} else {
Path poly_copy(poly);
poly_copy.push_back(poly[0]);
Paths out;
dash_path(poly_copy, out, dasharray);
offx.AddPaths(out, join_type, end_type);
}
}
for (const auto &poly : open_paths) {
Paths out;
dash_path(poly, out, dasharray);
offx.AddPaths(out, join_type, end_type);
}
/* Execute clipper offset operation to generate stroke outlines */
offx.Execute(ptree, 0.5 * stroke_width * clipper_scale);
/* Clip. Note that after the outline, all we have is closed paths as any open path's stroke outline is itself
* a closed path. */
if (!clip_path.empty()) {
Clipper c;
Paths outline_paths;
PolyTreeToPaths(ptree, outline_paths);
c.AddPaths(outline_paths, ptSubject, /* closed */ true);
c.AddPaths(clip_path, ptClip, /* closed */ true);
c.StrictlySimple(true);
/* fill rules are nonzero since both subject and clip have already been normalized by clipper. */
c.Execute(ctIntersection, ptree, pftNonZero, pftNonZero);
}
/* Call out to pattern tiler for pattern strokes. The stroke's outline becomes the clip here. */
if (stroke_color == GRB_PATTERN_FILL) {
string stroke_pattern_id = usvg_id_url(node.attribute("stroke").value());
Pattern *pattern = lookup_pattern(stroke_pattern_id);
if (!pattern) {
cerr << "Warning: Fill pattern with id \"" << stroke_pattern_id << "\" not found." << endl;
} else {
Paths clip;
PolyTreeToPaths(ptree, clip);
pattern->tile(clip);
}
} else {
Paths s_polys;
dehole_polytree(ptree, s_polys);
/* Export debug svg */
cairo_save(cr);
cairo_set_matrix(cr, &viewport_matrix);
cairo_new_path(cr);
ClipperLib::cairo::clipper_to_cairo(s_polys, cr, CAIRO_PRECISION, ClipperLib::cairo::tNone);
if (stroke_color == GRB_DARK) {
cairo_set_source_rgba(cr, 0.0, 0.0, 1.0, dbg_stroke_alpha);
} else { /* GRB_CLEAR */
cairo_set_source_rgba(cr, 1.0, 0.0, 0.0, dbg_stroke_alpha);
}
cairo_fill (cr);
/* export gerber */
cairo_identity_matrix(cr);
for (const auto &poly : s_polys) {
vector<array<double, 2>> out;
for (const auto &p : poly)
out.push_back(std::array<double, 2>{
((double)p.X) / clipper_scale, ((double)p.Y) / clipper_scale
});
std::cerr << "calling sink" << std::endl;
polygon_sink(out, stroke_color == GRB_DARK);
}
cairo_restore(cr);
}
}
}
void svg_plugin::SVGDocument::do_export(string debug_out_filename) {
assert(_valid);
/* Export the actual SVG document to both SVG for debuggin and to gerber. We do this as we go, i.e. we immediately
* process each element to gerber as we encounter it instead of first rendering everything to a giant list of gerber
* primitives and then serializing those later. Exporting them on the fly saves a ton of memory and is much faster.
*/
ClipperLib::Clipper c;
c.AddPaths(vb_paths, ptSubject, /* closed */ true);
ClipperLib::IntRect bbox = c.GetBounds();
cerr << "document viewbox clip: bbox={" << bbox.left << ", " << bbox.top << "} - {" << bbox.right << ", " << bbox.bottom << "}" << endl;
export_svg_group(root_elem, vb_paths);
}
void svg_plugin::SVGDocument::setup_debug_output(string filename) {
/* Setup cairo to draw into a SVG surface (for debugging). For actual rendering, something like a recording surface
* would work fine, too. */
/* Cairo expects the SVG surface size to be given in pt (72.0 pt = 1.0 in = 25.4 mm) */
const char *fn = filename.empty() ? nullptr : filename.c_str();
assert (!cr);
assert (!surface);
surface = cairo_svg_surface_create(fn, page_w_mm / 25.4 * 72.0, page_h_mm / 25.4 * 72.0);
cr = cairo_create (surface);
/* usvg returns "pixels", cairo thinks we draw "points" at 72.0 pt per inch. */
cairo_scale(cr, page_w / vb_w * 72.0 / assumed_usvg_dpi, page_h / vb_h * 72.0 / assumed_usvg_dpi);
cairo_translate(cr, -vb_x, -vb_y);
/* Store viewport transform and reset cairo's active transform. We have to do this since we have to render out all
* gerber primitives in mm, not px and most gerber primitives we export pass through Cairo at some point.
*
* We manually apply this viewport transform every time for debugging we actually use Cairo to export SVG. */
cairo_get_matrix(cr, &viewport_matrix);
cairo_identity_matrix(cr);
cairo_set_line_width (cr, 0.1);
cairo_set_source_rgba (cr, 1.0, 0.0, 0.0, 1.0);
}
void svg_plugin::SVGDocument::setup_viewport_clip() {
/* Set up view port clip path */
Path vb_path;
for (auto &elem : vector<pair<double, double>> {{vb_x, vb_y}, {vb_x+vb_w, vb_y}, {vb_x+vb_w, vb_y+vb_h}, {vb_x, vb_y+vb_h}}) {
double x = elem.first, y = elem.second;
vb_path.push_back({ (cInt)round(x * clipper_scale), (cInt)round(y * clipper_scale) });
cerr << "adding to path: " << (cInt)round(x * clipper_scale) << ", " << (cInt)round(y * clipper_scale) << endl;
}
vb_paths.push_back(vb_path);
ClipperLib::Clipper c;
c.AddPaths(vb_paths, ptSubject, /* closed */ true);
ClipperLib::IntRect bbox = c.GetBounds();
cerr << "did set up viewbox clip: bbox={" << bbox.left << ", " << bbox.top << "} - {" << bbox.right << ", " << bbox.bottom << "}" << endl;
export_svg_group(root_elem, vb_paths);
}
void svg_plugin::SVGDocument::load_patterns() {
/* Set up document-wide pattern registry. Load patterns from <defs> node. */
for (const auto &node : defs_node.children("pattern")) {
pattern_map.emplace(std::piecewise_construct, std::forward_as_tuple(node.attribute("id").value()), std::forward_as_tuple(node, *this));
}
}
void svg_plugin::SVGDocument::load_clips() {
/* Set up document-wide clip path registry: Extract clip path definitions from <defs> element */
for (const auto &node : defs_node.children("clipPath")) {
cairo_save(cr);
apply_cairo_transform_from_svg(cr, node.attribute("transform").value());
string meta_clip_path_id(usvg_id_url(node.attribute("clip-path").value()));
Clipper c;
/* The clipPath node can only contain <path> children. usvg converts all geometric objects (rect etc.) to
* <path>s. Raster images are invalid inside a clip path. usvg removes all groups that are not relevant to
* rendering, and the only way a group might stay is if it affects rasterization (e.g. through mask, clipPath).
*/
for (const auto &child : node.children("path")) {
PolyTree ptree;
cairo_save(cr);
/* TODO: we currently only support clipPathUnits="userSpaceOnUse", not "objectBoundingBox". */
apply_cairo_transform_from_svg(cr, child.attribute("transform").value());
load_svg_path(cr, child, ptree);
cairo_restore (cr);
Paths paths;
PolyTreeToPaths(ptree, paths);
c.AddPaths(paths, ptSubject, /* closed */ false);
}
/* Support clip paths that themselves have clip paths */
if (!meta_clip_path_id.empty()) {
if (clip_path_map.contains(meta_clip_path_id)) {
/* all clip paths must be closed */
c.AddPaths(clip_path_map[meta_clip_path_id], ptClip, /* closed */ true);
} else {
cerr << "Warning: Cannot find clip path with ID \"" << meta_clip_path_id << "\", ignoring." << endl;
}
}
PolyTree ptree;
c.StrictlySimple(true);
/* This unions all child <path>s together and at the same time applies any meta clip path. */
/* The fill rules are both nonzero since both subject and clip have already been normalized by clipper. */
c.Execute(ctUnion, ptree, pftNonZero, pftNonZero);
/* Insert into document clip path map */
PolyTreeToPaths(ptree, clip_path_map[node.attribute("id").value()]);
cairo_restore(cr);
}
}

97
src/svg_doc.h 100644
Wyświetl plik

@ -0,0 +1,97 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SVG_DOC_H
#define SVG_DOC_H
#include <map>
#include <pugixml.hpp>
#include "svg_pattern.h"
namespace svg_plugin {
typedef std::function<void (std::vector<std::array<double, 2>>, bool)> polygon_sink_fun;
class SVGDocument {
public:
SVGDocument() : _valid(false) {}
SVGDocument(polygon_sink_fun sink_fun) : _valid(false), polygon_sink(sink_fun) {}
~SVGDocument();
/* true -> load successful */
bool load(std::string filename, std::string debug_out_filename="/tmp/kicad_svg_debug.svg");
/* true -> load successful */
bool valid() const { return _valid; }
operator bool() const { return valid(); }
double mm_to_doc_units(double) const;
double doc_units_to_mm(double) const;
double width() const { return page_w_mm; }
double height() const { return page_h_mm; }
void do_export(std::string debug_out_filename="");
private:
friend class Pattern;
cairo_t *cairo() { return cr; }
const ClipperLib::Paths *lookup_clip_path(const pugi::xml_node &node);
Pattern *lookup_pattern(const std::string id);
void export_svg_group(const pugi::xml_node &group, ClipperLib::Paths &parent_clip_path);
void export_svg_path(const pugi::xml_node &node, ClipperLib::Paths &clip_path);
void setup_debug_output(std::string filename="");
void setup_viewport_clip();
void load_clips();
void load_patterns();
bool _valid;
pugi::xml_document svg_doc;
pugi::xml_node root_elem;
pugi::xml_node defs_node;
double vb_x, vb_y, vb_w, vb_h;
double page_w, page_h;
double page_w_mm, page_h_mm;
std::map<std::string, Pattern> pattern_map;
std::map<std::string, ClipperLib::Paths> clip_path_map;
cairo_matrix_t viewport_matrix;
ClipperLib::Paths vb_paths; /* viewport clip rect */
cairo_t *cr = nullptr;
cairo_surface_t *surface = nullptr;
polygon_sink_fun polygon_sink;
static constexpr double dbg_fill_alpha = 0.8;
static constexpr double dbg_stroke_alpha = 1.0;
static constexpr double assumed_usvg_dpi = 96.0;
};
} /* namespace svg_plugin */
#endif /* SVG_DOC_H */

181
src/svg_geom.cpp 100644
Wyświetl plik

@ -0,0 +1,181 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "svg_geom.h"
#include <cmath>
#include <string>
#include <sstream>
#include <assert.h>
#include <cairo.h>
#include "svg_import_defs.h"
using namespace ClipperLib;
using namespace std;
/* Get bounding box of a Clipper Paths */
IntRect svg_plugin::get_paths_bounds(const Paths &paths) {
if (paths.empty()) {
return {0, 0, 0, 0};
}
if (paths[0].empty()) {
return {0, 0, 0, 0};
}
IntPoint p0 = paths[0][0];
cInt x0=p0.X, y0=p0.Y, x1=p0.X, y1=p0.Y;
for (const Path &p : paths) {
for (const IntPoint ip : p) {
if (ip.X < x0)
x0 = ip.X;
if (ip.Y < y0)
y0 = ip.Y;
if (ip.X > x1)
x1 = ip.X;
if (ip.Y > y1)
y1 = ip.Y;
}
}
return {x0, y0, x1, y1};
}
enum ClipperLib::PolyFillType svg_plugin::clipper_fill_rule(const pugi::xml_node &node) {
string val(node.attribute("fill-rule").value());
if (val == "evenodd")
return ClipperLib::pftEvenOdd;
else
return ClipperLib::pftNonZero; /* default */
}
enum ClipperLib::EndType svg_plugin::clipper_end_type(const pugi::xml_node &node) {
string val(node.attribute("stroke-linecap").value());
if (val == "round")
return ClipperLib::etOpenRound;
if (val == "square")
return ClipperLib::etOpenSquare;
return ClipperLib::etOpenButt;
}
enum ClipperLib::JoinType svg_plugin::clipper_join_type(const pugi::xml_node &node) {
string val(node.attribute("stroke-linejoin").value());
if (val == "round")
return ClipperLib::jtRound;
if (val == "bevel")
return ClipperLib::jtSquare;
return ClipperLib::jtMiter;
}
/* Take a Clipper polytree, i.e. a description of a set of polygons, their holes and their inner polygons, and remove
* all holes from it. We remove holes by splitting each polygon that has a hole into two or more pieces so that the hole
* is no more. These pieces perfectly fit each other so there is no visual or functional difference.
*/
void svg_plugin::dehole_polytree(PolyNode &ptree, Paths &out) {
for (int i=0; i<ptree.ChildCount(); i++) {
PolyNode *nod = ptree.Childs[i];
assert(nod);
assert(!nod->IsHole());
/* First, recursively process inner polygons. */
for (int j=0; j<nod->ChildCount(); j++) {
PolyNode *child = nod->Childs[j];
assert(child);
assert(child->IsHole());
if (child->ChildCount() > 0) {
dehole_polytree(*child, out);
}
}
if (nod->ChildCount() == 0) {
out.push_back(nod->Contour);
} else {
/* Do not add children's children, those were handled in the recursive call above */
Clipper c;
c.AddPath(nod->Contour, ptSubject, /* closed= */ true);
for (int k=0; k<nod->ChildCount(); k++) {
c.AddPath(nod->Childs[k]->Contour, ptSubject, /* closed= */ true);
}
/* Find a viable cut: Cut from top-left bounding box corner, through two subsequent points on the hole
* outline and to top-right bbox corner. */
IntRect bbox = c.GetBounds();
Path tri = { { bbox.left, bbox.top }, nod->Childs[0]->Contour[0], nod->Childs[0]->Contour[1], { bbox.right, bbox.top } };
c.AddPath(tri, ptClip, true);
PolyTree solution;
c.StrictlySimple(true);
/* Execute twice, once for intersection fragment and once for difference fragment. Note that this will yield
* at least two, but possibly more polygons. */
c.Execute(ctDifference, solution, pftNonZero);
dehole_polytree(solution, out);
c.Execute(ctIntersection, solution, pftNonZero);
dehole_polytree(solution, out);
}
}
}
/* Intersect two clip paths. Both must share a coordinate system. */
void svg_plugin::combine_clip_paths(Paths &in_a, Paths &in_b, Paths &out) {
Clipper c;
c.StrictlySimple(true);
c.AddPaths(in_a, ptClip, /* closed */ true);
c.AddPaths(in_b, ptSubject, /* closed */ true);
/* Nonzero fill since both input clip paths must already have been preprocessed by clipper. */
c.Execute(ctIntersection, out, pftNonZero);
}
/* Transform given clipper paths under the given cairo transform. If no transform is given, use cairo's current
* user-to-device transform. */
void svg_plugin::transform_paths(cairo_t *cr, Paths &paths, cairo_matrix_t *mat) {
cairo_save(cr);
if (mat != nullptr) {
cairo_set_matrix(cr, mat);
}
for (Path &p : paths) {
transform(p.begin(), p.end(), p.begin(),
[cr](IntPoint p) -> IntPoint {
double x = p.X / clipper_scale, y = p.Y / clipper_scale;
cairo_user_to_device(cr, &x, &y);
return { (cInt)round(x * clipper_scale), (cInt)round(y * clipper_scale) };
});
}
cairo_restore(cr);
}

44
src/svg_geom.h 100644
Wyświetl plik

@ -0,0 +1,44 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SVG_GEOM_H
#define SVG_GEOM_H
#include <cairo.h>
#include <clipper.hpp>
#include <pugixml.hpp>
namespace svg_plugin {
ClipperLib::IntRect get_paths_bounds(const ClipperLib::Paths &paths);
enum ClipperLib::PolyFillType clipper_fill_rule(const pugi::xml_node &node);
enum ClipperLib::EndType clipper_end_type(const pugi::xml_node &node);
enum ClipperLib::JoinType clipper_join_type(const pugi::xml_node &node);
void dehole_polytree(ClipperLib::PolyNode &ptree, ClipperLib::Paths &out);
void combine_clip_paths(ClipperLib::Paths &in_a, ClipperLib::Paths &in_b, ClipperLib::Paths &out);
void transform_paths(cairo_t *cr, ClipperLib::Paths &paths, cairo_matrix_t *mat=nullptr);
} /* namespace svg_plugin */
#endif /* SVG_GEOM_H */

Wyświetl plik

@ -0,0 +1,49 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2016 CERN
* @author Janito V. Ferreira Filho <janito.vff@gmail.com>
* Copyright (C) 2018-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SVG_IMPORT_DEFS_H
#define SVG_IMPORT_DEFS_H
#include <cfloat>
template <typename T>
constexpr T ipow(T num, unsigned int pow)
{
return (pow >= sizeof(unsigned int)*8) ? 0 :
pow == 0 ? 1 : num * ipow(num, pow-1);
}
constexpr int CAIRO_PRECISION = 7;
constexpr double clipper_scale = ipow(10.0, CAIRO_PRECISION);
#define JC_VORONOI_IMPLEMENTATION
#define JCV_REAL_TYPE double
#define JCV_ATAN2 atan2
#define JCV_SQRT sqrt
#define JCV_FLT_MAX DBL_MAX
#define JCV_PI 3.141592653589793115997963468544185161590576171875
//define JCV_EDGE_INTERSECT_THRESHOLD 1.0e-10F
#endif /* SVG_IMPORT_DEFS_H */

Wyświetl plik

@ -0,0 +1,129 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <cmath>
#include "base64.h"
#include "svg_import_util.h"
using namespace std;
void svg_plugin::print_matrix(cairo_t *cr, bool print_examples) {
cairo_matrix_t mat;
cairo_get_matrix(cr, &mat);
cerr << " xform matrix = { xx=" << mat.xx << ", yx=" << mat.yx << ", xy=" << mat.xy << ", yy=" << mat.yy << ", x0=" << mat.x0 << ", y0=" << mat.y0 << " }" << endl;
if (print_examples) {
double x=0, y=0;
cairo_user_to_device(cr, &x, &y);
cerr << " (0, 0) -> (" << x << ", " << y << ")" << endl;
x = 1, y = 0;
cairo_user_to_device(cr, &x, &y);
cerr << " (1, 0) -> (" << x << ", " << y << ")" << endl;
x = 0, y = 1;
cairo_user_to_device(cr, &x, &y);
cerr << " (0, 1) -> (" << x << ", " << y << ")" << endl;
x = 1, y = 1;
cairo_user_to_device(cr, &x, &y);
cerr << " (1, 1) -> (" << x << ", " << y << ")" << endl;
}
}
/* Read a double value formatted like usvg formats doubles from an SVG attribute */
double svg_plugin::usvg_double_attr(const pugi::xml_node &node, const char *attr, double default_value) {
const auto *val = node.attribute(attr).value();
if (*val == '\0')
return default_value;
return atof(val);
}
/* Read an url from an usvg attribute */
string svg_plugin::usvg_id_url(string attr) {
if (attr.rfind("url(#", 0) == string::npos)
return string();
attr = attr.substr(strlen("url(#"));
attr = attr.substr(0, attr.size()-1);
return attr;
}
svg_plugin::RelativeUnits svg_plugin::map_str_to_units(string str, svg_plugin::RelativeUnits default_val) {
if (str == "objectBoundingBox")
return SVG_ObjectBoundingBox;
else if (str == "userSpaceOnUse")
return SVG_UserSpaceOnUse;
return default_val;
}
void svg_plugin::load_cairo_matrix_from_svg(const string &transform, cairo_matrix_t &mat) {
if (transform.empty()) {
cairo_matrix_init_identity(&mat);
return;
}
string start("matrix(");
assert(transform.substr(0, start.length()) == start);
assert(transform.back() == ')');
const string &foo = transform.substr(start.length(), transform.length());
const string &bar = foo.substr(0, foo.length() - 1);
istringstream xform(bar);
double a, c, e,
b, d, f;
xform >> a >> b >> c >> d >> e >> f;
assert(!xform.fail());
cairo_matrix_init(&mat, a, b, c, d, e, f);
}
void svg_plugin::apply_cairo_transform_from_svg(cairo_t *cr, const string &transform) {
cairo_matrix_t mat;
load_cairo_matrix_from_svg(transform, mat);
cairo_transform(cr, &mat); /* or cairo_transform? */
}
/* Cf. https://tools.ietf.org/html/rfc2397 */
string svg_plugin::parse_data_iri(const string &data_url) {
if (data_url.rfind("data:", 0) == string::npos) /* check if url starts with "data:" */
return string();
size_t foo = data_url.find("base64,");
if (foo == string::npos) /* check if this is actually a data URL */
return string();
size_t b64_begin = data_url.find_first_not_of(" ", foo + strlen("base64,"));
assert(b64_begin != string::npos);
return base64_decode(data_url.substr(b64_begin));
}
/* for debug svg output */
void svg_plugin::apply_viewport_matrix(cairo_t *cr, cairo_matrix_t &viewport_matrix) {
/* Multiply viewport matrix *from the left*, i.e. as if it had been applied *before* the currently set matrix. */
cairo_matrix_t old_matrix;
cairo_get_matrix(cr, &old_matrix);
cairo_set_matrix(cr, &viewport_matrix);
cairo_transform(cr, &old_matrix);
}

Wyświetl plik

@ -0,0 +1,69 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SVG_IMPORT_UTIL_H
#define SVG_IMPORT_UTIL_H
#include <math.h>
#include <cmath>
#include <stdlib.h>
#include <assert.h>
#include <limits>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <regex>
#include <pango/pangocairo.h>
#include <cairo-svg.h>
#include <clipper.hpp>
#include "cairo_clipper.hpp"
#include <pugixml.hpp>
#include "svg_import_defs.h"
namespace svg_plugin {
/* Coordinate system selection for things like "patternContentUnits" */
enum RelativeUnits {
SVG_UnknownUnits = 0,
SVG_UserSpaceOnUse,
SVG_ObjectBoundingBox,
};
void print_matrix(cairo_t *cr, bool print_examples=false);
double usvg_double_attr(const pugi::xml_node &node, const char *attr, double default_value=0.0);
std::string usvg_id_url(std::string attr);
RelativeUnits map_str_to_units(std::string str, RelativeUnits default_val=SVG_UnknownUnits);
void load_cairo_matrix_from_svg(const std::string &transform, cairo_matrix_t &mat);
void apply_cairo_transform_from_svg(cairo_t *cr, const std::string &transform);
std::string parse_data_iri(const std::string &data_url);
void apply_viewport_matrix(cairo_t *cr, cairo_matrix_t &viewport_matrix);
} /* namespace svg_plugin */
#endif /* SVG_IMPORT_UTIL_H */

219
src/svg_path.cpp 100644
Wyświetl plik

@ -0,0 +1,219 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <cmath>
#include <assert.h>
#include <iostream>
#include <sstream>
#include "cairo_clipper.hpp"
#include "svg_import_defs.h"
#include "svg_path.h"
using namespace std;
static void clipper_add_cairo_path(cairo_t *cr, ClipperLib::Clipper &c, bool closed) {
ClipperLib::Paths in_poly;
ClipperLib::cairo::cairo_to_clipper(cr, in_poly, CAIRO_PRECISION, ClipperLib::cairo::tNone);
c.AddPaths(in_poly, ClipperLib::ptSubject, closed);
}
static void path_to_clipper_via_cairo(cairo_t *cr, ClipperLib::Clipper &c, const pugi::char_t *path_data) {
istringstream d(path_data);
string cmd;
double x, y, c1x, c1y, c2x, c2y;
bool first = true;
bool path_is_empty = true;
while (!d.eof()) {
d >> cmd;
assert (!d.fail());
assert(!first || cmd == "M");
if (cmd == "Z") { /* Close path */
cairo_close_path(cr);
clipper_add_cairo_path(cr, c, /* closed= */ true);
cairo_new_path(cr);
path_is_empty = true;
} else if (cmd == "M") { /* Move to */
d >> x >> y;
/* We need to transform all points ourselves here, and cannot use the transform feature of cairo_to_clipper:
* Our transform may contain offsets, and clipper only passes its data into cairo's transform functions
* after scaling up to its internal fixed-point ints, but it does not scale the transform accordingly. This
* means a scale/rotation we set before calling clipper works out fine, but translations get lost as they
* get scaled by something like 1e-6.
*/
cairo_user_to_device(cr, &x, &y);
assert (!d.fail());
if (!first)
clipper_add_cairo_path(cr, c, /* closed= */ false);
cairo_new_path (cr);
path_is_empty = true;
cairo_move_to(cr, x, y);
} else if (cmd == "L") { /* Line to */
d >> x >> y;
cairo_user_to_device(cr, &x, &y);
assert (!d.fail());
cairo_line_to(cr, x, y);
path_is_empty = false;
} else { /* Curve to */
assert(cmd == "C");
d >> c1x >> c1y; /* first control point */
cairo_user_to_device(cr, &c1x, &c1y);
d >> c2x >> c2y; /* second control point */
cairo_user_to_device(cr, &c2x, &c2y);
d >> x >> y; /* end point */
cairo_user_to_device(cr, &x, &y);
assert (!d.fail());
cairo_curve_to(cr, c1x, c1y, c2x, c2y, x, y);
path_is_empty = false;
}
first = false;
}
if (!path_is_empty) {
cairo_close_path(cr);
clipper_add_cairo_path(cr, c, /* closed= */ false);
}
}
void svg_plugin::load_svg_path(cairo_t *cr, const pugi::xml_node &node, ClipperLib::PolyTree &ptree) {
auto *path_data = node.attribute("d").value();
auto fill_rule = clipper_fill_rule(node);
/* For open paths, clipper does not correctly remove self-intersections. Thus, we pass everything into
* clipper twice: Once with all paths set to "closed" to compute fill areas, and once with correct
* open/closed properties for stroke offsetting. */
cairo_set_tolerance (cr, 0.1); /* FIXME make configurable, scale properly for units */
cairo_set_fill_rule(cr, CAIRO_FILL_RULE_WINDING);
ClipperLib::Clipper c;
c.StrictlySimple(true);
path_to_clipper_via_cairo(cr, c, path_data);
/* We canont clip the polygon here since that would produce incorrect results for our stroke. */
c.Execute(ClipperLib::ctUnion, ptree, fill_rule, ClipperLib::pftNonZero);
}
void svg_plugin::parse_dasharray(const pugi::xml_node &node, vector<double> &out) {
out.clear();
string val(node.attribute("stroke-dasharray").value());
if (val.empty() || val == "none")
return;
istringstream desc_stream(val);
while (!desc_stream.eof()) {
/* usvg says the array only contains unitless (px) values. I don't know what resvg does with percentages inside
* dash arrays. We just assume everything is a unitless number here. In case usvg passes through percentages,
* well, bad luck. They are a kind of weird thing inside a dash array in the first place. */
double d;
desc_stream >> d;
out.push_back(d);
}
assert(out.size() % 2 == 0); /* according to resvg spec */
}
/* Take a Clipper path in clipper-scaled document units, and apply the given SVG dash array to it. Do this by walking
* the path from start to end while emitting dashes. */
void svg_plugin::dash_path(const ClipperLib::Path &in, ClipperLib::Paths &out, const vector<double> dasharray, double dash_offset) {
out.clear();
if (dasharray.empty() || in.size() < 2) {
out.push_back(in);
return;
}
size_t dash_idx = 0;
size_t num_dashes = dasharray.size();
while (dash_offset > dasharray[dash_idx]) {
dash_offset -= dasharray[dash_idx];
dash_idx = (dash_idx + 1) % num_dashes;
}
double dash_remaining = dasharray[dash_idx] - dash_offset;
ClipperLib::Path current_dash;
current_dash.push_back(in[0]);
double dbg_total_len = 0.0;
for (size_t i=1; i<in.size(); i++) {
ClipperLib::IntPoint p1(in[i-1]), p2(in[i]);
double x1 = p1.X / clipper_scale, y1 = p1.Y / clipper_scale, x2 = p2.X / clipper_scale, y2 = p2.Y / clipper_scale;
double dist = sqrt(pow(x2-x1, 2) + pow(y2-y1, 2));
dbg_total_len += dist;
if (dist < dash_remaining) {
/* dash extends beyond this segment, append this segment and continue. */
dash_remaining -= dist;
current_dash.push_back(p2);
} else {
/* dash started in some previous segment ends in this segment */
double dash_frac = dash_remaining/dist;
double x = x1 + (x2 - x1) * dash_frac,
y = y1 + (y2 - y1) * dash_frac;
ClipperLib::IntPoint intermediate {(ClipperLib::cInt)round(x * clipper_scale), (ClipperLib::cInt)round(y * clipper_scale)};
/* end this dash */
current_dash.push_back(intermediate);
if (dash_idx%2 == 0) { /* dash */
out.push_back(current_dash);
} /* else space */
dash_idx = (dash_idx + 1) % num_dashes;
double offset = dash_remaining;
/* start next dash */
current_dash.clear();
current_dash.push_back(intermediate);
/* handle case where multiple dashes fit into this segment */
while ((dist - offset) > dasharray[dash_idx]) {
offset += dasharray[dash_idx];
double dash_frac = offset/dist;
double x = x1 + (x2 - x1) * dash_frac,
y = y1 + (y2 - y1) * dash_frac;
ClipperLib::IntPoint intermediate {(ClipperLib::cInt)round(x * clipper_scale), (ClipperLib::cInt)round(y * clipper_scale)};
/* end this dash */
current_dash.push_back(intermediate);
if (dash_idx%2 == 0) { /* dash */
out.push_back(current_dash);
} /* else space */
dash_idx = (dash_idx + 1) % num_dashes;
/* start next dash */
current_dash.clear();
current_dash.push_back(intermediate);
}
dash_remaining = dasharray[dash_idx] - (dist - offset);
current_dash.push_back(p2);
}
}
}

38
src/svg_path.h 100644
Wyświetl plik

@ -0,0 +1,38 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SVG_PATH_H
#define SVG_PATH_H
#include <vector>
#include <cairo.h>
#include "svg_geom.h"
namespace svg_plugin {
void load_svg_path(cairo_t *cr, const pugi::xml_node &node, ClipperLib::PolyTree &ptree);
void parse_dasharray(const pugi::xml_node &node, std::vector<double> &out);
void dash_path(const ClipperLib::Path &in, ClipperLib::Paths &out, const std::vector<double> dasharray, double dash_offset=0.0);
}
#endif /* SVG_PATH_H */

119
src/svg_pattern.cpp 100644
Wyświetl plik

@ -0,0 +1,119 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <assert.h>
#include "svg_import_util.h"
#include "svg_pattern.h"
#include "svg_import_defs.h"
#include "svg_geom.h"
#include "svg_doc.h"
using namespace std;
svg_plugin::Pattern::Pattern(const pugi::xml_node &node, SVGDocument &doc) : _node(node), doc(&doc) {
/* Read pattern attributes from SVG node */
cerr << "creating pattern for node with id \"" << node.attribute("id").value() << "\"" << endl;
x = usvg_double_attr(node, "x");
y = usvg_double_attr(node, "y");
w = usvg_double_attr(node, "width");
h = usvg_double_attr(node, "height");
patternTransform = node.attribute("patternTransform").value();
string vb_s(node.attribute("viewBox").value());
has_vb = !vb_s.empty();
if (has_vb) {
istringstream vb_stream(vb_s);
vb_stream >> vb_x >> vb_y >> vb_w >> vb_h;
}
patternUnits = map_str_to_units(node.attribute("patternUnits").value(), SVG_ObjectBoundingBox);
patternContentUnits = map_str_to_units(node.attribute("patternContentUnits").value(), SVG_UserSpaceOnUse);
}
/* Tile pattern into gerber. Note that this function may be called several times in case the pattern is
* referenced from multiple places, so we must not clobber any of the object's state. */
void svg_plugin::Pattern::tile (ClipperLib::Paths &clip) {
assert(doc);
cairo_t *cr = doc->cairo();
assert(cr);
cairo_save(cr);
/* Transform x, y, w, h from pattern coordinate space into parent coordinates by applying the inverse
* patternTransform. This is necessary so we iterate over the correct bounds when tiling below */
cairo_matrix_t mat;
load_cairo_matrix_from_svg(patternTransform, mat);
if (cairo_matrix_invert(&mat) != CAIRO_STATUS_SUCCESS) {
cerr << "Cannot invert patternTransform matrix on pattern \"" << _node.attribute("id").value() << "\"." << endl;
cairo_restore(cr);
}
double inst_x = x, inst_y = y, inst_w = w, inst_h = h;
cairo_user_to_device(cr, &inst_x, &inst_y);
cairo_user_to_device_distance(cr, &inst_w, &inst_h);
cairo_restore(cr);
ClipperLib::IntRect clip_bounds = get_paths_bounds(clip);
double bx = clip_bounds.left / clipper_scale;
double by = clip_bounds.top / clipper_scale;
double bw = (clip_bounds.right - clip_bounds.left) / clipper_scale;
double bh = (clip_bounds.bottom - clip_bounds.top) / clipper_scale;
if (patternUnits == SVG_ObjectBoundingBox) {
inst_x *= bw;
inst_y *= bh;
inst_w *= bw;
inst_h *= bh;
}
/* Switch to pattern coordinates */
cairo_save(cr);
cairo_translate(cr, bx, by);
apply_cairo_transform_from_svg(cr, patternTransform);
/* Iterate over all pattern tiles in pattern coordinates */
for (double inst_off_x = fmod(inst_x, inst_w) - inst_w;
inst_off_x < bw + inst_w;
inst_off_x += inst_w) {
for (double inst_off_y = fmod(inst_y, inst_h) - inst_h;
inst_off_y < bh + inst_h;
inst_off_y += inst_h) {
cairo_save(cr);
/* Change into this individual tile's coordinate system */
cairo_translate(cr, inst_off_x, inst_off_y);
if (has_vb) {
cairo_translate(cr, vb_x, vb_y);
cairo_scale(cr, inst_w / vb_w, inst_h / vb_h);
} else if (patternContentUnits == SVG_ObjectBoundingBox) {
cairo_scale(cr, bw, bh);
}
/* Export the pattern tile's content like a group */
doc->export_svg_group(_node, clip);
cairo_restore(cr);
}
}
cairo_restore(cr);
}

60
src/svg_pattern.h 100644
Wyświetl plik

@ -0,0 +1,60 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef SVG_PATTERN_H
#define SVG_PATTERN_H
#include <string>
#include <cairo.h>
#include <pugixml.hpp>
#include <clipper.hpp>
#include "svg_import_util.h"
namespace svg_plugin {
class SVGDocument;
class Pattern {
public:
Pattern() {}
Pattern(const pugi::xml_node &node, SVGDocument &doc);
void tile (ClipperLib::Paths &clip);
private:
double x, y, w, h;
double vb_x, vb_y, vb_w, vb_h;
bool has_vb;
std::string patternTransform;
enum RelativeUnits patternUnits;
enum RelativeUnits patternContentUnits;
const pugi::xml_node _node;
SVGDocument *doc = nullptr;
};
} /* namespace svg_plugin */
#endif /* SVG_PATTERN_H */

339
src/vec_core.cpp 100644
Wyświetl plik

@ -0,0 +1,339 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include <cmath>
#include <string>
#include <iostream>
#include <vector>
#include <opencv2/opencv.hpp>
#include "svg_import_util.h"
#include "vec_core.h"
#include "svg_import_defs.h"
#include "jc_voronoi.h"
using namespace svg_plugin;
using namespace std;
/* debug function */
static void dbg_show_cv_image(cv::Mat &img) {
string windowName = "Debug image";
cv::namedWindow(windowName);
cv::imshow(windowName, img);
cv::waitKey(0);
cv::destroyWindow(windowName);
}
/* From jcv voronoi README */
static void voronoi_relax_points(const jcv_diagram* diagram, jcv_point* points) {
const jcv_site* sites = jcv_diagram_get_sites(diagram);
for (int i=0; i<diagram->numsites; i++) {
const jcv_site* site = &sites[i];
jcv_point sum = site->p;
int count = 1;
const jcv_graphedge* edge = site->edges;
while (edge) {
sum.x += edge->pos[0].x;
sum.y += edge->pos[0].y;
count++;
edge = edge->next;
}
points[site->index].x = sum.x / count;
points[site->index].y = sum.y / count;
}
}
/* Render image into gerber file.
*
* This function renders an image into a number of vector primitives emulating the images grayscale brightness by
* differently sized vector shaped giving an effect similar to halftone printing used in newspapers.
*
* On a high level, this function does this in four steps:
* 1. It preprocesses the source image at the pixel level. This involves several tasks:
* 1.1. It converts the image to grayscale.
* 1.2. It scales the image up or down to match the given minimum feature size.
* 1.3. It applies a blur depending on the given minimum feature size to prevent aliasing artifacts.
* 2. It randomly spread points across the image using poisson disc sampling. This yields points that have a fairly even
* average distance to each other across the image, and that have a guaranteed minimum distance that depends on
* minimum feature size.
* 3. It calculates a voronoi map based on this set of points and it calculats the polygon shape of each cell of the
* voronoi map.
* 4. It scales each of these voronoi cell polygons to match the input images brightness at the spot covered by this
* cell.
*/
void vectorizer::vectorize_image(cairo_t *cr, const pugi::xml_node &node, double min_feature_size_px, ClipperLib::Paths &clip_path, cairo_matrix_t &viewport_matrix) {
/* Read XML node attributes */
auto x = usvg_double_attr(node, "x", 0.0);
auto y = usvg_double_attr(node, "y", 0.0);
auto width = usvg_double_attr(node, "width", 0.0);
auto height = usvg_double_attr(node, "height", 0.0);
assert (width > 0 && height > 0);
cerr << "image elem: w="<<width<<", h="<<height<<endl;
/* Read image from data:base64... URL */
string img_data = parse_data_iri(node.attribute("xlink:href").value());
if (img_data.empty()) {
cerr << "Warning: Empty or invalid image element with id \"" << node.attribute("id").value() << "\"" << endl;
return;
}
/* slightly annoying round-trip through the std:: and cv:: APIs */
vector<unsigned char> img_vec(img_data.begin(), img_data.end());
cv::Mat data_mat(img_vec, true);
cv::Mat img = cv::imdecode(data_mat, cv::ImreadModes::IMREAD_GRAYSCALE | cv::ImreadModes::IMREAD_ANYDEPTH);
data_mat.release();
if (img.empty()) {
cerr << "Warning: Could not decode content of image element with id \"" << node.attribute("id").value() << "\"" << endl;
return;
}
/* Set up target transform using SVG transform and x/y attributes */
cairo_save(cr);
apply_cairo_transform_from_svg(cr, node.attribute("transform").value());
cairo_translate(cr, x, y);
/* Adjust minimum feature size given in mm and translate into px document units in our local coordinate system. */
double f_x = min_feature_size_px, f_y = 0;
cairo_device_to_user_distance(cr, &f_x, &f_y);
min_feature_size_px = sqrt(f_x*f_x + f_y*f_y);
/* For both our debug SVG output and for the gerber output, we have to paint the image's bounding box in black as
* background for our halftone blobs. We cannot simply draw a rect here, though. Instead we have to first intersect
* the bounding box with the clip path we get from the caller, then we have to translate it into Cairo-SVG's
* document units. */
/* First, setup the bounding box rectangle in our local px coordinate space. */
ClipperLib::Path rect_path;
for (auto &elem : vector<pair<double, double>> {{0, 0}, {width, 0}, {width, height}, {0, height}}) {
double x = elem.first, y = elem.second;
cairo_user_to_device(cr, &x, &y);
rect_path.push_back({ (ClipperLib::cInt)round(x * clipper_scale), (ClipperLib::cInt)round(y * clipper_scale) });
}
/* Intersect the bounding box with the caller's clip path */
ClipperLib::Clipper c;
c.AddPath(rect_path, ClipperLib::ptSubject, /* closed */ true);
if (!clip_path.empty()) {
c.AddPaths(clip_path, ClipperLib::ptClip, /* closed */ true);
}
ClipperLib::Paths rect_out;
c.StrictlySimple(true);
c.Execute(ClipperLib::ctIntersection, rect_out, ClipperLib::pftNonZero, ClipperLib::pftNonZero);
/* Finally, translate into Cairo-SVG's document units and draw. */
cairo_save(cr);
cairo_set_matrix(cr, &viewport_matrix);
cairo_new_path(cr);
ClipperLib::cairo::clipper_to_cairo(rect_out, cr, CAIRO_PRECISION, ClipperLib::cairo::tNone);
cairo_set_source_rgba (cr, 0.0, 0.0, 0.0, 1.0);
/* First, draw into SVG */
cairo_fill(cr);
cairo_restore(cr);
/* Second, draw into gerber. */
cairo_save(cr);
cairo_identity_matrix(cr);
for (const auto &poly : rect_out) {
/* FIXME */
//export_as_gerber(cr, poly, /* dark */ false);
}
cairo_restore(cr);
/* Set up a poisson-disc sampled point "grid" covering the image. Calculate poisson disc parameters from given
* minimum feature size. */
double grayscale_overhead = 0.8; /* fraction of distance between two adjacent cell centers that is reserved for
grayscale interpolation. Larger values -> better grayscale resolution,
larger cells. */
double center_distance = min_feature_size_px * 2.0 * (1.0 / (1.0-grayscale_overhead));
vector<d2p> *grid_centers = sample_poisson_disc(width, height, min_feature_size_px * 2.0 * 2.0);
/* TODO make these alternative grids available to callers */
//vector<d2p> *grid_centers = sample_hexgrid(width, height, center_distance);
//vector<d2p> *grid_centers = sample_squaregrid(width, height, center_distance);
/* Target factor between given min_feature_size and intermediate image pixels,
* i.e. <scale_featuresize_factor> px ^= min_feature_size */
double scale_featuresize_factor = 3.0;
/* TODO: support for preserveAspectRatio attribute */
double px_w = width / min_feature_size_px * scale_featuresize_factor;
double px_h = height / min_feature_size_px * scale_featuresize_factor;
/* Scale intermediate image (step 1.2) to have <scale_featuresize_factor> pixels per min_feature_size. */
cv::Mat scaled(cv::Size{(int)round(px_w), (int)round(px_h)}, img.type());
cv::resize(img, scaled, scaled.size(), 0, 0);
img.release();
/* Blur image with a kernel larger than our minimum feature size to avoid aliasing. */
cv::Mat blurred(scaled.size(), scaled.type());
int blur_size = (int)ceil(fmax(scaled.cols / width, scaled.rows / height) * center_distance);
cv::GaussianBlur(scaled, blurred, {blur_size, blur_size}, 0, 0);
scaled.release();
/* Calculate voronoi diagram for the grid generated above. */
jcv_diagram diagram;
memset(&diagram, 0, sizeof(jcv_diagram));
jcv_rect rect {{0.0, 0.0}, {width, height}};
jcv_point *pts = reinterpret_cast<jcv_point *>(grid_centers->data()); /* hackety hack */
jcv_diagram_generate(grid_centers->size(), pts, &rect, 0, &diagram);
/* Relax points, i.e. wiggle them around a little bit to equalize differences between cell sizes a little bit. */
voronoi_relax_points(&diagram, pts);
memset(&diagram, 0, sizeof(jcv_diagram));
jcv_diagram_generate(grid_centers->size(), pts, &rect, 0, &diagram);
/* For each voronoi cell calculated above, find the brightness of the blurred image pixel below its center. We do
* not have to average over the entire cell's area here: The blur is doing a good approximation of that while being
* simpler and faster.
*
* We do this step before generating the cell poygons below because we have to look up a cell's neighbor's fill
* factor during gap filling for minimum feature size preservation. */
vector<double> fill_factors(diagram.numsites); /* Factor to be multiplied with site polygon radius to yield target
fill level */
const jcv_site* sites = jcv_diagram_get_sites(&diagram);
int j = 0;
for (int i=0; i<diagram.numsites; i++) {
const jcv_point center = sites[i].p;
double pxd = (double)blurred.at<unsigned char>(
(int)round(center.y / height * blurred.rows),
(int)round(center.x / width * blurred.cols)) / 255.0;
fill_factors[sites[i].index] = sqrt(pxd);
}
/* Minimum gap between adjacent scaled site polygons. */
double min_gap_px = min_feature_size_px;
vector<double> adjusted_fill_factors;
adjusted_fill_factors.reserve(32); /* Vector to hold adjusted fill factors for each edge for gap filling */
/* now iterate over all voronoi cells again to generate each cell's scaled polygon halftone blob. */
for (int i=0; i<diagram.numsites; i++) {
const jcv_point center = sites[i].p;
double fill_factor_ours = fill_factors[sites[i].index];
/* Do not render halftone blobs that are too small */
if (fill_factor_ours * 0.5 * center_distance < min_gap_px)
continue;
/* Iterate over this cell's edges. For each edge, check the gap that would result between this cell's halftone
* blob and the neighboring cell's halftone blob based on their fill factors. If the gap is too small, either
* widen it by adjusting both fill factors down a bit (for this edge only!), or eliminate it by setting both
* fill factors to 1.0 (again, for this edge only!). */
adjusted_fill_factors.clear();
const jcv_graphedge* e = sites[i].edges;
while (e) {
/* half distance between both neighbors of this edge, i.e. sites[i] and its neighbor. */
/* Note that in a voronoi tesselation, this edge is always halfway between. */
double adjusted_fill_factor = fill_factor_ours;
if (e->neighbor != nullptr) { /* nullptr -> edge is on the voronoi map's border */
double rad = sqrt(pow(center.x - e->neighbor->p.x, 2) + pow(center.y - e->neighbor->p.y, 2)) / 2.0;
double fill_factor_theirs = fill_factors[e->neighbor->index];
double gap_px = (1.0 - fill_factor_ours) * rad + (1.0 - fill_factor_theirs) * rad;
if (gap_px > min_gap_px) {
/* all good. gap is wider than minimum. */
} else if (gap_px > 0.5 * min_gap_px) {
/* gap is narrower than minimum, but more than half of minimum width. */
/* force gap open, distribute adjustment evenly on left/right */
double fill_factor_adjustment = (min_gap_px - gap_px) / 2.0 / rad;
adjusted_fill_factor -= fill_factor_adjustment;
} else {
/* gap is less than half of minimum width. Force gap closed. */
adjusted_fill_factor = 1.0;
}
}
adjusted_fill_factors.push_back(adjusted_fill_factor);
e = e->next;
}
/* Now, generate the actual halftone blob polygon */
ClipperLib::Path cell_path;
double last_fill_factor = adjusted_fill_factors.back();
e = sites[i].edges;
j = 0;
while (e) {
double fill_factor = adjusted_fill_factors[j];
if (last_fill_factor != fill_factor) {
/* Fill factor was adjusted since last edge, so generate one extra point so we have a nice radial
* "step". */
double x = e->pos[0].x;
double y = e->pos[0].y;
x = center.x + (x - center.x) * fill_factor;
y = center.y + (y - center.y) * fill_factor;
cairo_user_to_device(cr, &x, &y);
cell_path.push_back({ (ClipperLib::cInt)round(x * clipper_scale), (ClipperLib::cInt)round(y * clipper_scale) });
}
/* Emit endpoint of current edge */
double x = e->pos[1].x;
double y = e->pos[1].y;
x = center.x + (x - center.x) * fill_factor;
y = center.y + (y - center.y) * fill_factor;
cairo_user_to_device(cr, &x, &y);
cell_path.push_back({ (ClipperLib::cInt)round(x * clipper_scale), (ClipperLib::cInt)round(y * clipper_scale) });
j += 1;
last_fill_factor = fill_factor;
e = e->next;
}
/* Now, clip the halftone blob generated above against the given clip path. We do this individually for each
* blob since this way is *much* faster than throwing a million blobs at once at poor clipper. */
ClipperLib::Paths polys;
ClipperLib::Clipper c;
c.AddPath(cell_path, ClipperLib::ptSubject, /* closed */ true);
if (!clip_path.empty()) {
c.AddPaths(clip_path, ClipperLib::ptClip, /* closed */ true);
}
c.StrictlySimple(true);
c.Execute(ClipperLib::ctIntersection, polys, ClipperLib::pftNonZero, ClipperLib::pftNonZero);
/* Export halftone blob to debug svg */
cairo_save(cr);
cairo_set_matrix(cr, &viewport_matrix);
cairo_new_path(cr);
ClipperLib::cairo::clipper_to_cairo(polys, cr, CAIRO_PRECISION, ClipperLib::cairo::tNone);
cairo_set_source_rgba(cr, 1, 1, 1, 1);
cairo_fill(cr);
cairo_restore(cr);
/* And finally, export halftone blob to gerber. */
cairo_save(cr);
cairo_identity_matrix(cr);
for (const auto &poly : polys) {
/* FIXME */
//export_as_gerber(cr, poly, /* dark */ true);
}
cairo_restore(cr);
}
blurred.release();
jcv_diagram_free( &diagram );
delete grid_centers;
cairo_restore(cr);
}

37
src/vec_core.h 100644
Wyświetl plik

@ -0,0 +1,37 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef VEC_CORE_H
#define VEC_CORE_H
#include <cairo.h>
#include <pugixml.hpp>
#include <clipper.hpp>
#include "vec_grid.h"
namespace vectorizer {
void vectorize_image(cairo_t *cr, const pugi::xml_node &node, double min_feature_size_px, ClipperLib::Paths &clip_path, cairo_matrix_t &viewport_matrix);
}
#endif /* VEC_CORE_H */

105
src/vec_grid.cpp 100644
Wyświetl plik

@ -0,0 +1,105 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "poisson_disk_sampling.h"
#include "vec_grid.h"
using namespace std;
using namespace vectorizer;
sampling_fun vectorizer::get_sampler(enum grid_type type) {
switch(type) {
case POISSON_DISC:
return sample_poisson_disc;
case HEXGRID:
return sample_hexgrid;
case SQUAREGRID:
return sample_squaregrid;
default:
return sample_poisson_disc;
}
}
vector<d2p> *vectorizer::sample_poisson_disc(double w, double h, double center_distance) {
d2p top_left {0, 0};
d2p bottom_right {w, h};
return new auto(thinks::PoissonDiskSampling(center_distance, top_left, bottom_right));
}
vector<d2p> *vectorizer::sample_hexgrid(double w, double h, double center_distance) {
double radius = center_distance / 2.0 / (sqrt(3) / 2.0); /* radius of hexagon */
double pitch_v = 1.5 * radius;
double pitch_h = center_distance;
/* offset of first hexagon to make sure the entire area is covered. We use slightly larger values here to avoid
* corner cases during clipping in the voronoi map generator. The inaccuracies this causes at the edges are
* negligible. */
double off_x = 0.5001 * center_distance;
double off_y = 0.5001 * radius;
/* NOTE: The voronoi generator is not quite stable when points lie outside the bounds. Thus, floor(). */
long long int points_x = floor(w / pitch_h);
long long int points_y = floor(h / pitch_v);
vector<d2p> *out = new vector<d2p>();
out->reserve((points_x+1) * points_y);
/* This may generate up to one extra row of points. We don't care since these points will simply be clipped during
* voronoi map generation. */
for (long long int y_i=0; y_i<points_y; y_i+=2) {
for (long long int x_i=0; x_i<points_x; x_i++) { /* allow one extra point to compensate for row shift */
out->push_back(d2p{off_x + x_i * pitch_h, off_y + y_i * pitch_v});
}
for (long long int x_i=0; x_i<points_x+1; x_i++) { /* allow one extra point to compensate for row shift */
out->push_back(d2p{off_x + (x_i - 0.5) * pitch_h, off_y + (y_i + 1) * pitch_v});
}
}
return out;
}
vector<d2p> *vectorizer::sample_squaregrid(double w, double h, double center_distance) {
/* offset of first square to make sure the entire area is covered. We use slightly larger values here to avoid
* corner cases during clipping in the voronoi map generator. The inaccuracies this causes at the edges are
* negligible. */
double off_x = 0.5 * center_distance;
double off_y = 0.5 * center_distance;
long long int points_x = ceil(w / center_distance);
long long int points_y = ceil(h / center_distance);
vector<d2p> *out = new vector<d2p>();
out->reserve(points_x * points_y);
for (long long int y_i=0; y_i<points_y; y_i++) {
for (long long int x_i=0; x_i<points_x; x_i++) {
out->push_back({off_x + x_i*center_distance, off_y + y_i*center_distance});
}
}
return out;
}

52
src/vec_grid.h 100644
Wyświetl plik

@ -0,0 +1,52 @@
/*
* This program source code file is part of KICAD, a free EDA CAD application.
*
* Copyright (C) 2021 Jan Sebastian Götte <kicad@jaseg.de>
* Copyright (C) 2021 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, you may find one here:
* http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
* or you may search the http://www.gnu.org website for the version 2 license,
* or you may write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
#ifndef VEC_GRID_H
#define VEC_GRID_H
#include <array>
#include <vector>
#include <functional>
namespace vectorizer {
typedef std::array<double, 2> d2p;
enum grid_type {
POISSON_DISC,
HEXGRID,
SQUAREGRID
};
typedef std::function<std::vector<d2p> *(double, double, double)> sampling_fun;
sampling_fun get_sampler(enum grid_type type);
std::vector<d2p> *sample_poisson_disc(double w, double h, double center_distance);
std::vector<d2p> *sample_hexgrid(double w, double h, double center_distance);
std::vector<d2p> *sample_squaregrid(double w, double h, double center_distance);
} /* namespace vectorizer */
#endif /* VEC_GRID_H */

Wyświetl plik

@ -0,0 +1,69 @@
<html>
<head>
<script type="text/javascript" src="../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Deprecated</title>
<link rel="stylesheet" href="../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="_Body.htm" class="Banner">Overview</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Deprecated</h1>
<p class="Body"> The precompiler directive <b>'use_deprecated'</b> allows users to update the Clipper library without being forced to make immediate changes to code that accesses the library. Depricated code will be removed in a future update. (Enabled by default.)<br><br> <b>Deprecated types and functions:</b><br><br> All deprecated code has been removed from version 6.2.0.
<!-- <table cellspacing="2" cellpadding="2" border="0">
<tr>
<td width="140px">&nbsp;</td>
<td>Replaced by &nbsp;</td>
</tr>
</table>
--> </p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,234 @@
<html>
<head>
<script type="text/javascript" src="../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Example</title>
<link rel="stylesheet" href="../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="_Body.htm" class="Banner">Overview</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Example</h1>
<table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="600px">
<th align="left">Delphi Code Sample:
</th>
<tr>
<td class="White">
<pre class="brush: delphi;">
uses
graphics32, clipper;
function GetEllipsePoints(bounds: TIntRect): TPath;
begin
//code to create an elliptical polygon here
end;
procedure DrawPolygons(polys: TPaths; color: TColor32);
begin
//code to display the polygons here
end;
var
sub, clp, sol: TPaths;
begin
//set up the subject and clip polygons ...
setlength(sub, 3);
sub[0] := GetEllipsePoints(IntRect(100,100,300,300));
sub[1] := GetEllipsePoints(IntRect(125,130,275,180));
sub[2] := GetEllipsePoints(IntRect(125,220,275,270));
setlength(clp, 1);
clp[0] := GetEllipsePoints(IntRect(140,70,220,320));
//display the subject and clip polygons ...
DrawPolygons(sub, 0x8033FFFF);
DrawPolygons(clp, 0x80FFFF33);
//get the intersection of the subject and clip polygons ...
with TClipper.Create do
try
AddPaths(sub, ptSubject, true);
AddPaths(clp, ptClip, true);
Execute(ctIntersection, sol, pftEvenOdd, pftEvenOdd);
finally
free;
end;
//finally draw the intersection polygons ...
DrawPolygons(sol, 0x40808080);
</pre>
</td>
</tr>
</table>
<div style="clear:both">&nbsp;</div>
<table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="600px">
<th align="left">C++ Code Sample:
</th>
<tr>
<td class="White">
<pre class="brush: cpp;">
#include "clipper.hpp"
...
//from clipper.hpp ...
//typedef long long cInt;
//struct IntPoint {cInt X; cInt Y;};
//typedef std::vector&lt;IntPoint&gt; Path;
//typedef std::vector&lt;Polygon&gt; Paths;
using namespace ClipperLib;
void GetEllipsePoints(IntRect& bounds, Path& p)
{/* ... */}
void DrawPolygons(Paths& p, unsigned color)
{/* ... */}
int main()
{
//set up the subject and clip polygons ...
Paths sub(3);
GetEllipsePoints(IntRect(100,100,300,300), sub[0]);
GetEllipsePoints(IntRect(125,130,275,180), sub[1]);
GetEllipsePoints(IntRect(125,220,275,270), sub[2]);
Paths clp(1);
GetEllipsePoints(IntRect(140,70,220,320), clp[0]);
//display the subject and clip polygons ...
DrawPolygons(sub, 0x8033FFFF);
DrawPolygons(clp, 0x80FFFF33);
//get the intersection of the subject and clip polygons ...
Clipper clpr;
clpr.AddPaths(sub, ptSubject, true);
clpr.AddPaths(clp, ptClip, true);
Paths solution;
clpr.Execute(ctIntersection, solution, pftEvenOdd, pftEvenOdd);
//finally draw the intersection polygons ...
DrawPolygons(solution, 0x40808080);
}
</pre>
</td>
</tr>
</table>
<div style="clear:both">&nbsp;</div>
<table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="600px">
<th align="left">C# Code Sample:
</th>
<tr>
<td class="White">
<pre class="brush: csharp;">
...
using ClipperLib;
...
using Path = List&lt;IntPoint&gt;;
using Paths = List&lt;List&lt;IntPoint&gt;&gt;;
static Path GetEllipsePoints(IntRect bounds)
{/* ... */}
static void DrawPolygons(Path p, uint color)
{/* ... */}
static void Main(string[] args)
{
Paths subjs = new Paths(3);
subjs.Add(GetEllipsePoints(new IntRect(100,100,300,300)));
subjs.Add(GetEllipsePoints(new IntRect(125,130,275,180)));
subjs.Add(GetEllipsePoints(new IntRect(125,220,275,270)));
Paths clips = new Paths(1);
clips.Add(GetEllipsePoints(new IntRect(140,70,220,320)));
DrawPolygons(subjs, 0x8033FFFF);
DrawPolygons(clips, 0x80FFFF33);
Paths solution = new Paths();
Clipper c = new Clipper();
c.AddPaths(subjs, PolyType.ptSubject, true);
c.AddPaths(clips, PolyType.ptClip, true);
c.Execute(ClipType.ctIntersection, solution);
DrawPolygons(solution, 0x40808080);
}
</pre>
</td>
</tr>
</table>
<div style="clear:both">&nbsp;</div>
<img src="../../Images/sample1.png" alt="" border="0">
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,104 @@
<html>
<head>
<script type="text/javascript" src="../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>FAQ</title>
<link rel="stylesheet" href="../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="_Body.htm" class="Banner">Overview</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>FAQ</h1>
<p class="Decl5">Why does Clipper use integer coordinates, not floats?</p>
<p class="Decl4">This has been done to preserve <a href="http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf" target="_blank">numerical robustness</a>. Early versions of the library did use floating point coordinates, but it became apparent that floating point imprecision was always going to cause occasional errors.<br><br> </p>
<p class="Decl5">How do I use floating point coordinates with Clipper?</p>
<p class="Decl4">It's a simple task to multiply your floating point coordinates by a scaling factor (that's typically a power of 10 depending on the desired precision). Then with the solution paths, divide the returned coordinates by this same scaling factor. Clipper accepts integer coordinates as large as &plusmn;4.6e18, so it can accommodate very large scaling.<br><br> </p>
<p class="Decl5">Does Clipper handle polygons with holes?</p>
<p class="Decl4">'Holes' are defined by the specified <a href="../Units/ClipperLib/Types/PolyFillType.htm">polygon filling rule</a>. (See also <a href="../Units/ClipperLib/Classes/Clipper/Methods/Execute.htm">Clipper.Execute</a>)<br><br> </p>
<p class="Decl5">Some polygons in the solution share a common edge. Is this a bug?</p>
<p class="Decl4"> No, though this should happen rarely as of version 6. (See <a href="../Units/ClipperLib/Classes/Clipper/Methods/Execute.htm">Clipper.Execute</a> for more about this.)<br><br> </p>
<p class="Decl5">I have lots of polygons that I want to 'union'. Can I do this in one operation?</p>
<p class="Decl4"> Yes. Just add all the polygons as subject polygons to the Clipper object. (You don't have to assign both subject and clip polygons.)<br><br> </p>
<p class="Decl5"> <img src="../../Images/kangaroo_small.png" width="292" height="292" alt="" align="right"> The polygons produced by <a href="../Units/ClipperLib/Classes/ClipperOffset/_Body.htm">ClipperOffset</a> have tiny artefacts? Could this be a bug?</p>
<p class="Decl4"> Make sure the input polygons don't self-intersect. Tiny self-intersections can sometimes be produced by previous clipping operations. These can be cleaned up using the <a href="../Units/ClipperLib/Functions/CleanPolygon.htm">CleanPolygon</a> and <a href="../Units/ClipperLib/Functions/CleanPolygons.htm">CleanPolygons</a> functions. Also, make sure the supplied polygons don't overlap. If they do, offset these separately. Finally, the precision of the input coordinates may be a problem. Because the Clipper Library only operates on integer coordinates, you may need to scale your coordinates (eg by a factor of 10) to improve precision. <br><br> </p>
<p class="Decl5">Is there an easy way to reverse polygon orientations?</p>
<p class="Decl4"> Yes, see <a href="../Units/ClipperLib/Functions/ReversePaths.htm">ReversePaths</a>. <br><br> </p>
<div style="clear:both">&nbsp;</div>
<p class="Decl5">My drawings contain lots of beziers, ellipses and arcs. How can I perform clipping operations on these?</p>
<p class="Decl4"> You'll have to convert them to 'flattened' paths. For an example of how this can be done (and even reconstructed back into beziers, arcs etc), see the CurvesDemo application included in this library. <br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Units/ClipperLib/Classes/Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="../Units/ClipperLib/Classes/ClipperOffset/_Body.htm">ClipperOffset</a>, <a href="../Units/ClipperLib/Functions/CleanPolygon.htm">CleanPolygon</a>, <a href="../Units/ClipperLib/Functions/CleanPolygons.htm">CleanPolygons</a>, <a href="../Units/ClipperLib/Functions/ReversePaths.htm">ReversePaths</a>, <a href="../Units/ClipperLib/Types/PolyFillType.htm">PolyFillType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,75 @@
<html>
<head>
<script type="text/javascript" src="../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>License</title>
<link rel="stylesheet" href="../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="_Body.htm" class="Banner">Overview</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>License</h1>
<p class="Body"> The Clipper Library (including Delphi, C++ &amp; C# source code, other accompanying code, examples and documentation), hereafter called "the Software", has been released under the following license, terms and conditions:</p>
<p class="Body">Boost Software License - Version 1.0 - August 17th, 2003<br> <a href="http://www.boost.org/LICENSE_1_0.txt" target="_blank">http://www.boost.org/LICENSE_1_0.txt</a></p>
<p class="Body">Permission is hereby granted, free of charge, to any person or organization obtaining a copy of the Software covered by this license to use, reproduce, display, distribute, execute, and transmit the Software, and to prepare derivative works of the Software, and to permit third-parties to whom the Software is furnished to do so, all subject to the following:</p>
<p class="Body">The copyright notices in the Software and this entire statement, including the above license grant, this restriction and the following disclaimer, must be included in all copies of the Software, in whole or in part, and all derivative works of the Software, unless such copies or derivative works are solely in the form of machine-executable object code generated by a source language processor.</p>
<p class="Body">THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.</p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,71 @@
<html>
<head>
<script type="text/javascript" src="../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Rounding</title>
<link rel="stylesheet" href="../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="_Body.htm" class="Banner">Overview</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Rounding</h1>
<p class="Body"> By using an integer type for polygon coordinates, the Clipper Library has been able to avoid problems of <a href="http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf"><b>numerical robustness</b></a> that can cause havoc with geometric computations. Problems associated with integer <b>rounding</b> and their possible solutions are discussed below.<br><br> <img src="../../Images/clipper_rounding.png" width="488" height="365" alt="" align="left"> <span class="maroon">It's important to stress at the outset that rounding causes vertices to move fractions of a unit away from their 'true' positions. Nevertheless, the resulting imprecision can be very effectively managed by appropriate scaling.</span><br><br> The Clipper Library supports scaling to <span class="maroon">very high degrees of precision</span> by accepting integer coordinate values in the range &plusmn;0x3FFFFFFFFFFFFFFF (± 4.6e+18).<br><br> Another complication of using a discrete numbers (as opposed to <a href="http://en.wikipedia.org/wiki/Real_number" target="_blank">real numbers</a>) is that very occasionally tiny <b>self-intersection</b> artefacts arise. In the unscaled image on the left (where one unit equals one pixel), the area of intersection of two polygons has been highlighted in bright green.<br><br> </p>
<p class="Body" style="clear='both'"> <img src="../../Images/clipper_rounding2.png" width="440" height="316" alt="" align="right"><br><br> A 30X 'close up' of the lower points of intersection of these same two polygons shows the presence of a tiny self-intersecting artefact. The three 'black dots' highlight the actual points of intersection (with their fractional coordinates displayed). The 'red dots' show where these points of intersection are located once rounding is applied. With a little care you can see that rounding reverses the orientation of these vertices and causes a tiny self-intersecting artefact.<br><br> Although these tiny self-intersections are uncommon, if it's deemed necessary, they are best removed with <a href="../Units/ClipperLib/Functions/CleanPolygons.htm">CleanPolygons</a>. (Setting Clipper's <a href="../Units/ClipperLib/Classes/Clipper/Properties/StrictlySimple.htm">StrictlySimple</a> property to true would also address this self-intersection but the tiny (sub-unit) polygon 'artefact' with incorrect orientation would still appear in the solution.) <br><br> </p>
<p class="Body" style="clear='both'"> <img src="../../Images/clipper_rounding4.png" width="292" height="224" alt="" align="left"><br><br> In this final example, the single polygon on the left also has a tiny self-intersection. However, the clipping algorithm sees this vertex (88,50) as simply 'touching' rather than intersecting the right edge of the polygon (though only by a fraction of a unit). Since this intersection won't normally be detected, the clipping solution (eg following a union operation) will still contain this tiny self-intersection. Setting Clipper's <a href="../Units/ClipperLib/Classes/Clipper/Properties/StrictlySimple.htm">StrictlySimple</a> property to true avoids this uncommon problem.<br><br> </p>
<div style="clear='both'"></div>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Units/ClipperLib/Classes/Clipper/Properties/StrictlySimple.htm">Clipper.StrictlySimple</a>, <a href="../Units/ClipperLib/Functions/CleanPolygons.htm">CleanPolygons</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,106 @@
<html>
<head>
<script type="text/javascript" src="../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Overview</title>
<link rel="stylesheet" href="../../Styles/default.css" type="text/css">
<meta name="keywords" content="clipper,clipping,clip,intersection,union,polygon,offset,library,algorithm,line">
<script type="text/javascript" src="../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Overview</h1>
<p class="Body"> The <a href="../_Body.htm"><b>Clipper Library</b></a> performs <b><a href="../Units/ClipperLib/Types/ClipType.htm">clipping</a></b>, and <a href="../Units/ClipperLib/Classes/ClipperOffset/_Body.htm"><b>offsetting</b></a> of both lines and polygons.<br><br> A number of features set Clipper apart from other clipping libraries:
<ul>
<li>it accepts all types of polygons including self-intersecting ones</li>
<li>it supports multiple polygon filling rules (EvenOdd, NonZero, Positive, Negative)</li>
<li>it's very fast relative to <a href="http://www.angusj.com/delphi/clipper.php#features" target="_blank">other libraries</a></li>
<li>it's <a href="http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf" target="_blank">numerically robust</a></li>
<li>it also performs line and polygon offsetting</li>
<li>it's free to use in both freeware and commercial applications</li>
</ul> <br> </p>
<p class="Body"> <b>Current Version:</b> 6.2.1<br><br> <b>Author &amp; copyright:</b><br> Angus Johnson. Copyright &copy; 2010-2014<br> License, terms and conditions: <a href="./License.htm">Boost Software License</a><br><br> </p>
<p class="Body" id="terminology"> <img src="../../Images/int.png" alt="" border="0" align="right"> <b>Terminology:</b><br>
<ul>
<li><b>Clipping:</b> commonly refers to the process of cutting away from a set of 2-dimensional geometric shapes those parts that are outside a rectangular '<em>clipping</em>' window. This can be achieved by <em>intersecting</em> subject paths (lines and polygons) with a clipping rectangle. In a more general sense, the clipping window need not be rectangular but can be any type of polygon, even multiple polygons. Also, while clipping typically refers to an <em>intersection</em> operation, in this documentation it will refer to any one of the <a href="../Units/ClipperLib/Types/ClipType.htm">four boolean operations</a> (intersection, union, difference and exclusive-or).</li>
<li><b>Path:</b> is an ordered sequence of vertices defining a single geometric contour that's either a line (an open path) or a polygon (a closed path).</li>
<li><b>Line:</b> or polyline is an <em>open</em> path containing 2 or more vertices.</li>
<li><b>Polygon:</b> commonly refers to a two-dimensional region bounded by an outer non-intersecting closed contour. That region may also contain a number of 'holes'. In this documentation however, polygon will simply refer to a <em>closed</em> path.</li>
<li><b>Contour:</b> synonymous with path.</li>
<li><b>Hole:</b> is a closed region within a polygon that's not part of the polygon. A 'hole polygon' is a closed path that forms the outer boundaries of a hole.</li>
<li><b>Polygon Filling Rule:</b> the <a href="../Units/ClipperLib/Types/PolyFillType.htm"><b>filling rule</b></a>, together with a list of closed paths, defines those regions (bounded by paths) that are <em>inside</em> (ie regions 'brush filled' in a graphical display) and those which are <em>outside</em> (ie 'holes').</li>
</ul><br> </p>
<p class="Body"> <b>Distribution package contents:</b><br><br> The ZIP package contains the Clipper library's source code, a Windows CHM help file, HTML help, and a number of compiled demo applications (with full source code). The library was initially written in <strong>Delphi Pascal</strong> (and compiles with Delphi version 7 or above) but now contains <strong>C++</strong>, <strong>C#</strong> and <strong>Python</strong> translations too. The library's source code in each language is about 5000 lines. The Delphi code contains reasonably extensive comments, but comments are fewer in the C++ and C# code. The included sample applications show how Clipper can be used with the different languages using a number of graphics display libraries including - <b>AGG, Cairo, OpenGL, Graphics32, GDI+</b> and <b>SVG</b>.<br><br> <b>Download Link:</b><br><br> <a href="http://sourceforge.net/projects/polyclipping">SourceForge</a><br><br> <b>References:</b><br><br> The Library is based on but significantly extends Bala Vatti's polygon clipping algorithm as described in <a href="http://portal.acm.org/citation.cfm?id=129906" target="_blank">"A generic solution to polygon clipping"</a>, Communications of the ACM, Vol 35, Issue 7 (July 1992) pp 56-63.<br><br> A section in <a href="http://books.google.com/books?q=vatti+clipping+agoston" target="_blank">"Computer graphics and geometric modeling: implementation and algorithms"</a> by By Max K. Agoston (Springer, 2005) discussing <em>Vatti Polygon Clipping</em> was also helpful in creating the initial Clipper implementation.<br><br> The paper titled <a href="http://www.me.berkeley.edu/~mcmains/pubs/DAC05OffsetPolygon.pdf">"Polygon Offsetting by Computing Winding Numbers"</a> by Chen & McMains (Paper no. DETC2005-85513, ASME 2005. Pages 565-575) contains helpful discussion on the complexities of polygon offsetting together with some solutions.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../_Body.htm">Source</a>, <a href="License.htm">License</a>, <a href="../Units/ClipperLib/Classes/Clipper/_Body.htm">Clipper</a>, <a href="../Units/ClipperLib/Classes/ClipperOffset/_Body.htm">ClipperOffset</a>, <a href="../Units/ClipperLib/Types/ClipType.htm">ClipType</a>, <a href="../Units/ClipperLib/Types/PolyFillType.htm">PolyFillType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,95 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Constructor</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">Clipper</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Clipper.Constructor</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>constructor</b> TClipper.Create(InitOptions: <a href="../../../Types/InitOptions.htm">TInitOptions</a> = []);</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> Clipper::Clipper(<b>int</b> initOptions = 0) : ClipperBase();</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public</b> Clipper(initOptions = 0): base() {};</p>
<p class="Body"> The Clipper constructor creates an instance of the Clipper class. One or more <a href="../../../Types/InitOptions.htm">InitOptions</a> may be passed as a parameter to set the corresponding properties. (These properties can still be set or reset after construction.)<br><br> Examples:<br><br>
<table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="600px">
<tr>
<td class="White">
<pre class="brush: delphi;">
//C++ constructor setting StrictlySimple and PreserveCollinear properties ...
Clipper clipper(ioStrictlySimple | ioPreserveCollinear);
//C# constructor setting StrictlySimple and PreserveCollinear properties ...
Clipper clipper = new Clipper(Clipper.ioStrictlySimple | Clipper.ioPreserveCollinear);
//Delphi constructor setting StrictlySimple and PreserveCollinear properties ...
clipper := TClipper.Create([ioStrictlySimple, ioPreserveCollinear]);
</pre>
</td>
</tr>
</table> <div style="clear:both">&nbsp;</div> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Properties/PreserveCollinear.htm">PreserveCollinear</a>, <a href="../Properties/ReverseSolution.htm">ReverseSolution</a>, <a href="../Properties/StrictlySimple.htm">StrictlySimple</a>, <a href="../../../Types/InitOptions.htm">InitOptions</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,91 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Execute</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">Clipper</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Clipper.Execute</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span><br> <b>function</b> Execute(clipType: <a href="../../../Types/ClipType.htm">TClipType</a>;<br> &nbsp;&nbsp;<b>out</b> solution: <a href="../../../Types/Paths.htm">TPaths</a>;<br> &nbsp;&nbsp;subjFillType: <a href="../../../Types/PolyFillType.htm">TPolyFillType</a> = pftEvenOdd;<br> &nbsp;&nbsp;clipFillType: <a href="../../../Types/PolyFillType.htm">TPolyFillType</a> = pftEvenOdd): boolean; <b>overload</b>;<br><br> <b>function</b> Execute(clipType: <a href="../../../Types/ClipType.htm">TClipType</a>;<br> &nbsp;&nbsp;<b>out</b> solution: <a href="../../PolyTree/_Body.htm">TPolyTree</a>;<br> &nbsp;&nbsp;subjFillType: <a href="../../../Types/PolyFillType.htm">TPolyFillType</a> = pftEvenOdd;<br> &nbsp;&nbsp;clipFillType: <a href="../../../Types/PolyFillType.htm">TPolyFillType</a> = pftEvenOdd): boolean; <b>overload</b>; </p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span><br> <b>bool</b> Execute(<a href="../../../Types/ClipType.htm">ClipType</a> clipType,<br> &nbsp;&nbsp;<a href="../../../Types/Paths.htm">Paths</a> &amp;solution,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> subjFillType = pftEvenOdd,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> clipFillType = pftEvenOdd);<br><br> <b>bool</b> Execute(<a href="../../../Types/ClipType.htm">ClipType</a> clipType,<br> &nbsp;&nbsp;<a href="../../PolyTree/_Body.htm">PolyTree</a> &amp;solution,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> subjFillType = pftEvenOdd,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> clipFillType = pftEvenOdd); </p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span><br> <b>public bool</b> Execute(<a href="../../../Types/ClipType.htm">ClipType</a> clipType,<br> &nbsp;&nbsp;<a href="../../../Types/Paths.htm">Paths</a> solution,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> subjFillType,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> clipFillType);<br><br> <b>public bool</b> Execute(<a href="../../../Types/ClipType.htm">ClipType</a> clipType,<br> &nbsp;&nbsp;<a href="../../PolyTree/_Body.htm">PolyTree</a> solution,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> subjFillType,<br> &nbsp;&nbsp;<a href="../../../Types/PolyFillType.htm">PolyFillType</a> clipFillType); </p>
<br>
<p class="Body"> Once <em>subject</em> and <em>clip</em> paths have been assigned (via <a href="../../ClipperBase/Methods/AddPath.htm">AddPath</a> and/or <a href="../../ClipperBase/Methods/AddPaths.htm">AddPaths</a>), <b>Execute</b> can then perform the clipping operation (intersection, union, difference or XOR) specified by the <a href="../../../Types/ClipType.htm">clipType</a> parameter.<br><br> The <b>solution</b> parameter can be either a <a href="../../../Types/Paths.htm">Paths</a> or <a href="../../PolyTree/_Body.htm">PolyTree</a> structure. <span class="maroon">The Paths structure is simpler than the PolyTree stucture.</span> Because of this it is quicker to populate and hence clipping performance is a little better (it's roughly 10% faster). However, the PolyTree data structure provides more information about the returned paths which may be important to users. Firstly, <span class="maroon">the PolyTree structure preserves nested parent-child polygon relationships</span> (ie outer polygons owning/containing <em>holes</em> and holes owning/containing other outer polygons etc). Also, <span class="maroon"><b>only the PolyTree structure can differentiate between open and closed paths</b></span> since each PolyNode has an <a href="../../PolyNode/Properties/IsOpen.htm"><b>IsOpen</b></a> property. (The <a href="../../../Types/Path.htm"><b>Path</b></a> structure has no member indicating whether it's open or closed.) For this reason, <span class="maroon"><b>when <em>open</em> paths are passed to a Clipper object, the user must use a PolyTree object as the solution parameter</b></span>, otherwise an exception will be raised.<br><br> When a PolyTree object is used in a clipping operation on <b>open</b> paths, two ancilliary functions have been provided to quickly separate out <em>open</em> and <em>closed</em> paths from the solution - <a href="../../../Functions/OpenPathsFromPolyTree.htm"><b>OpenPathsFromPolyTree</b></a> and <a href="../../../Functions/ClosedPathsFromPolyTree.htm"><b>ClosedPathsFromPolyTree</b></a>. <a href="../../../Functions/PolyTreeToPaths.htm"><b>PolyTreeToPaths</b></a> is also available to convert path data to a Paths structure (irrespective of whether they're <em>open</em> or <em>closed</em>).<br><br> <img src="../../../../../../Images/common_edges.png" alt="" border="0" align="right"> There are several things to note about the solution paths returned:
<ul>
<li>they aren't in any specific order</li>
<li>they should never overlap or be self-intersecting (but see notes on <a href="../../../../../Overview/Rounding.htm"><b>rounding</b></a>)</li>
<li>holes will be oriented opposite outer polygons</li>
<li>the <strong>solution fill type</strong> can be considered either <em>EvenOdd</em> or <em>NonZero</em> since it will comply with either filling rule</li>
<li>polygons may rarely share a common edge (though this is now <em>very rare</em> as of version 6)</li>
</ul> </p><br>
<p class="Body"> The <b>subjFillType</b> and <b>clipFillType</b> parameters define the polygon <a href="../../../Types/PolyFillType.htm"><b>fill rule</b></a> to be applied to the polygons (ie closed paths) in the subject and clip paths respectively. (It's usual though obviously not essential that both sets of polygons use the same fill rule.)<br><br> <b>Execute</b> can be called multiple times without reassigning subject and clip polygons (ie when different clipping operations are required on the same polygon sets).<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../../Overview/Example.htm">Example</a>, <a href="../../../../../Overview/Rounding.htm">Rounding</a>, <a href="../../ClipperBase/Methods/AddPath.htm">ClipperBase.AddPath</a>, <a href="../../ClipperBase/Methods/AddPaths.htm">ClipperBase.AddPaths</a>, <a href="../../PolyNode/Properties/IsOpen.htm">PolyNode.IsOpen</a>, <a href="../../PolyTree/_Body.htm">PolyTree</a>, <a href="../../../Functions/ClosedPathsFromPolyTree.htm">ClosedPathsFromPolyTree</a>, <a href="../../../Functions/OpenPathsFromPolyTree.htm">OpenPathsFromPolyTree</a>, <a href="../../../Functions/PolyTreeToPaths.htm">PolyTreeToPaths</a>, <a href="../../../Types/ClipType.htm">ClipType</a>, <a href="../../../Types/Path.htm">Path</a>, <a href="../../../Types/Paths.htm">Paths</a>, <a href="../../../Types/PolyFillType.htm">PolyFillType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,74 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>PreserveCollinear</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">Clipper</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Clipper.PreserveCollinear</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> PreserveCollinear: boolean; <b>override</b>;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> void PreserveCollinear(bool value);</p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public</b> bool PreserveCollinear { get {} set {} };</p>
<p class="Body"> <br> By default, when three or more vertices are collinear in input polygons (subject or clip), the Clipper object removes the 'inner' vertices before clipping. When enabled the PreserveCollinear property prevents this default behavior to allow these inner vertices to appear in the solution. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Methods/Constructor.htm">Constructor</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,76 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ReverseSolution</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">Clipper</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Clipper.ReverseSolution</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> ReverseSolution: boolean; <b>override</b>;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> void ReverseSolution(bool value);</p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public</b> bool ReverseSolution { get {} set {} };</p>
<p class="Body"> When this property is set to true, polygons returned in the <b>solution</b> parameter of the <a href="../Methods/Execute.htm">Execute()</a> method will have orientations opposite to their normal orientations. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Methods/Execute.htm">Execute</a>, <a href="../../../Functions/Orientation.htm">Orientation</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,88 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>StrictlySimple</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">Clipper</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Clipper.StrictlySimple</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> StrictlySimple: boolean; <b>override</b>;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> void StrictlySimple(bool value);</p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public</b> bool StrictlySimple { get {} set {} };</p>
<p class="Body"> <br> <b>Terminology:</b><br>
<ul>
<li>A <em>simple</em> polygon is one that does not self-intersect.</li>
<li>A <em>weakly simple</em> polygon is a simple polygon that contains 'touching' vertices, or 'touching' edges.</li>
<li>A <em>strictly simple</em> polygon is a simple polygon that does not contain 'touching' vertices, or 'touching' edges.</li>
</ul> </p>
<p class="Body"> Vertices 'touch' if they share the same coordinates (and are not adjacent). An edge touches another if one of its end vertices touches another edge excluding its adjacent edges, or if they are co-linear and overlapping (including adjacent edges).<br><br> Polygons returned by clipping operations (see <a href="../Methods/Execute.htm">Clipper.Execute()</a>) should always be simple polygons. When the <b>StrictlySimply</b> property is enabled, polygons returned will be <em>strictly simple</em>, otherwise they may be <em>weakly simple</em>. It's <b>computationally expensive</b> ensuring polygons are <em>strictly simple</em> and so this property is disabled by default.<br><br> <em>Note: There's currently no guarantee that polygons will be strictly simple since 'simplifying' is still a work in progress.</em><br><br> <img src="../../../../../../Images/simplify2.png" alt="" border="0"> <img src="../../../../../../Images/simplify3.png" alt="" border="0"><br> </p>
<p class="Body"> In the image above, the two examples show weakly simple polygons being broken into two strictly simple polygons. (The outlines with arrows are intended to aid visualizing vertex order.)<br><br> See also the article on <a href="http://en.wikipedia.org/wiki/Simple_polygon" target="_blank">Simple Polygons</a> on Wikipedia. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Methods/Execute.htm">Execute</a>, <a href="../../../Functions/SimplifyPolygons.htm">SimplifyPolygons</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,75 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ZFillFunction</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">Clipper</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Clipper.ZFillFunction</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> ZFillFunction: <a href="../../../Types/ZFillCallback.htm">TZFillCallback</a> <b>read</b> FZFillCallback <b>write</b> FZFillCallback;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>void</b> ZFillFunction(<a href="../../../Types/ZFillCallback.htm">ZFillCallback</a> zFillFunc);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public</b> <a href="../../../Types/ZFillCallback.htm">ZFillCallback</a> ZFillFunction { <b>get</b>; <b>set</b>; };</p>
<br>
<p class="Body"> <span class="maroon">This property is only exposed when the pre-processor directive <a href="../../../PreProcessor/Defines.htm"><b>use_xyz</b></a> has been defined.</span> If this is the case, a 'Z' member will be included in the <a href="../../../Types/IntPoint.htm">IntPoint</a> structure where users can store custom data. While most vertices in a clipping solution will correspond to input (subject and clip) vertices, there will also be new vertices wherever edges intersect. This property assigns a custom callback function to the Clipper object so that custom 'Z' values can be assigned to these intersection vertices. (Note that 'Z' values in the solution at non-intersecting vertices will simply be copied from matching input vertices along with the X and Y values.) <br><br> It is up to the library user to assign 'Z' values for new intersection vertices (otherwise these values will remain 0). The four vertices that define the intersecting line segments will be passed to the callback function (together with the new intersection vertex) to aid the user in determining appropriate Z values.<br><br>
<!-- The <b>CurvesDemo</b> application in the Curves directory in the distribution zip package shows how the Z member together with the callback function can be used to flatten curved paths (defined by control points) and after clipping, to 'de-flatten' or reconstruct curved paths in the clipping solution.<br><br>
--> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../PreProcessor/Defines.htm">Defines</a>, <a href="../../../Types/IntPoint.htm">IntPoint</a>, <a href="../../../Types/ZFillCallback.htm">ZFillCallback</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,149 @@
<html>
<head>
<script type="text/javascript" src="../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Clipper</title>
<link rel="stylesheet" href="../../../../../Styles/default.css" type="text/css">
<meta name="Ancestor" content="ClipperBase">
<script type="text/javascript" src="../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../_Body.htm" class="Banner"><img src="../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Clipper</h1>
<h2>Hierarchy</h2>
<p class="Hierarchy"></p>
<p class="Hierarchy">&nbsp;&nbsp;&nbsp;|</p>
<p class="Hierarchy"><a href="../ClipperBase/_Body.htm">ClipperBase</a></p>
<br>
<p class="Body"> The <b>Clipper</b> class encapsulates <a href="../../Types/ClipType.htm">boolean operations on polygons</a> (intersection, union, difference and XOR), which is also called <a href="../../../../Overview/_Body.htm#terminology">polygon clipping</a>.<br><br> Input polygons, both <em>subject</em> and <em>clip</em> sets, are passed to a Clipper object by its <a href="../ClipperBase/Methods/AddPath.htm">AddPath</a> and <a href="../ClipperBase/Methods/AddPaths.htm">AddPaths</a> methods, and the clipping operation is performed by calling its <a href="./Methods/Execute.htm">Execute</a> method. Multiple boolean operations can be performed on the same input polygon sets by repeat calls to Execute.<br><br> </p>
<h2 id="Auto-Reference">Reference</h2>
<table>
<tr><th>Fields
</th><th>Methods
</th><th>Properties
</th>
</tr>
<tr>
<td colspan="2" class="White">In Clipper:
</td>
</tr>
<tr>
<td>
</td>
<td><a href="Methods/Constructor.htm">Constructor</a>
</td>
<td><a href="Properties/PreserveCollinear.htm">PreserveCollinear</a>
</td>
</tr>
<tr>
<td>
</td>
<td><a href="Methods/Execute.htm">Execute</a>
</td>
<td><a href="Properties/ReverseSolution.htm">ReverseSolution</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Properties/StrictlySimple.htm">StrictlySimple</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Properties/ZFillFunction.htm">ZFillFunction</a>
</td>
</tr>
<tr>
<td colspan="2" class="White">In ClipperBase:
</td>
</tr>
<tr>
<td>
</td>
<td><a href="../ClipperBase/Methods/AddPath.htm">AddPath</a>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td><a href="../ClipperBase/Methods/AddPaths.htm">AddPaths</a>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td><a href="../ClipperBase/Methods/Clear.htm">Clear</a>
</td>
<td>
</td>
</tr>
<tr>
<td>
</td>
<td><a href="../ClipperBase/Methods/GetBounds.htm">GetBounds</a>
</td>
<td>
</td>
</tr>
</table>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../Overview/_Body.htm">Overview</a>, <a href="../../Types/ClipType.htm">ClipType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,95 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>AddPath</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperBase</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperBase.AddPath</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> AddPath(<b>const</b> path: <a href="../../../Types/Path.htm">TPath</a>; polyType: <a href="../../../Types/PolyType.htm">TPolyType</a>; Closed: Boolean): Boolean;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>bool</b> AddPath(<b>const</b> <a href="../../../Types/Path.htm">Path</a> &amp;pg, <a href="../../../Types/PolyType.htm">PolyType</a> polyType, <b>bool</b> closed);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public virtual bool</b> AddPath(<a href="../../../Types/Path.htm">Path</a> pg, <a href="../../../Types/PolyType.htm">PolyType</a> polyType, <b>bool</b> closed);</p>
<br>
<p class="Body"> <img src="../../../../../../Images/line_clipping.png" alt="" border="0" align="right"> Any number of subject and clip paths can be added to a clipping task, either individually via the AddPath() method, or as groups via the AddPaths() method, or even using both methods.<br><br> 'Subject' paths may be either <em>open</em> (lines) or <em>closed</em> (polygons) or even a mixture of both, but <span class="maroon"><b>'clipping' paths must always be <em>closed</em></b></span>. Clipper allows polygons to clip both lines and other polygons, but doesn't allow lines to clip either lines or polygons.<br><br> With closed paths, <a href="../../../Functions/Orientation.htm">orientation</a> should conform with the <a href="../../../Types/PolyFillType.htm">filling rule</a> that will be passed via Clippper's <a href="../../Clipper/Methods/Execute.htm">Execute</a> method.<br><br> </p>
<p class="Body"><b>Path Coordinate range</b>:<br> Path coordinates must be between &plusmn; 0x3FFFFFFFFFFFFFFF (&plusmn; <b>4.6e+18</b>), otherwise a range error will be thrown when attempting to add the path to the Clipper object. If coordinates can be kept between &plusmn; 0x3FFFFFFF (&plusmn; <b>1.0e+9</b>), a modest increase in performance (approx. 15-20%) over the larger range can be achieved by avoiding large integer math. If the preprocessor directive <a href="../../../PreProcessor/Defines.htm"><b>use_int32</b></a> is defined (allowing a further increase in performance of 20-30%), then the maximum range is restricted to &plusmn; 32,767. <br><br></p>
<p class="Body"> <b>Return Value:</b><br> The function will return false if the path is invalid for clipping. A path is invalid for clipping when:
<ul>
<li>it has less than 2 vertices</li>
<li>it has 2 vertices but is not an open path</li>
<li>the vertices are all co-linear and it is not an open path</li>
</ul> </p>
<br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../../Overview/Example.htm">Example</a>, <a href="../../Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="AddPaths.htm">AddPaths</a>, <a href="../../../Functions/Orientation.htm">Orientation</a>, <a href="../../../PreProcessor/Defines.htm">Defines</a>, <a href="../../../Types/Path.htm">Path</a>, <a href="../../../Types/PolyFillType.htm">PolyFillType</a>, <a href="../../../Types/PolyType.htm">PolyType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,93 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>AddPaths</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperBase</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperBase.AddPaths</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> AddPaths(<b>const</b> paths: <a href="../../../Types/Paths.htm">TPaths</a>; polyType: <a href="../../../Types/PolyType.htm">TPolyType</a>; Closed: Boolean): boolean;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>bool</b> AddPaths(<b>const</b> <a href="../../../Types/Paths.htm">Paths</a> &amp;ppg, <a href="../../../Types/PolyType.htm">PolyType</a> polyType, <b>bool</b> closed);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public virtual bool</b> AddPaths(<a href="../../../Types/Paths.htm">Paths</a> ppg, <a href="../../../Types/PolyType.htm">PolyType</a> polyType, <b>bool</b> closed);</p>
<br>
<p class="Body"> <img src="../../../../../../Images/line_clipping.png" alt="" border="0" align="right"> Any number of subject and clip paths can be added to a clipping task, either individually via the AddPath() method, or as groups via the AddPaths() method, or even using both methods.<br><br> 'Subject' paths may be either <em>open</em> (lines) or <em>closed</em> (polygons) or even a mixture of both, but <span class="maroon"><b>'clipping' paths must always be <em>closed</em></b></span>. Clipper allows polygons to clip both lines and other polygons, but doesn't allow lines to clip either lines or polygons.<br><br> With closed paths, <a href="../../../Functions/Orientation.htm">orientation</a> should conform with the <a href="../../../Types/PolyFillType.htm">filling rule</a> that will be passed via Clippper's <a href="../../Clipper/Methods/Execute.htm">Execute</a> method.<br><br> </p>
<p class="Body"><b>Path Coordinate range</b>:<br> Path coordinates must be between &plusmn; 0x3FFFFFFFFFFFFFFF (&plusmn; <b>4.6e+18</b>), otherwise a range error will be thrown when attempting to add the path to the Clipper object. If coordinates can be kept between &plusmn; 0x3FFFFFFF (&plusmn; <b>1.0e+9</b>), a modest increase in performance (approx. 15-20%) over the larger range can be achieved by avoiding large integer math. If the preprocessor directive <a href="../../../PreProcessor/Defines.htm"><b>use_int32</b></a> is defined (allowing a further increase in performance of 20-30%), then the maximum range is restricted to &plusmn; 32,767. <br><br></p>
<p class="Body"> <b>Return Value:</b><br> The function will return false if the path is invalid for clipping. A path is invalid for clipping when:
<ul>
<li>it has less than 2 vertices</li>
<li>it has 2 vertices but is not an open path</li>
<li>the vertices are all co-linear and it is not an open path</li>
</ul> </p>
<br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../../Overview/Example.htm">Example</a>, <a href="../../Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="AddPaths.htm">AddPaths</a>, <a href="../../../Functions/Orientation.htm">Orientation</a>, <a href="../../../PreProcessor/Defines.htm">Defines</a>, <a href="../../../Types/Paths.htm">Paths</a>, <a href="../../../Types/PolyFillType.htm">PolyFillType</a>, <a href="../../../Types/PolyType.htm">PolyType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,71 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Clear</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperBase</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperBase.Clear</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>procedure</b> Clear;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>virtual void</b> Clear();</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> public void Clear() {};</p>
<p class="Body"> The <b>Clear</b> method removes any existing subject and clip polygons allowing the Clipper object to be reused for clipping operations on <em>different</em> polygon sets.</p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,76 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>GetBounds</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperBase</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperBase.GetBounds</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> GetBounds: <a href="../../../Types/IntRect.htm">TIntRect</a>;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <a href="../../../Types/IntRect.htm">IntRect</a> GetBounds();</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public</b> <a href="../../../Types/IntRect.htm">IntRect</a> GetBounds() {...};</p>
<br>
<p class="Body"> This method returns the axis-aligned bounding rectangle of all polygons that have been added to the Clipper object. </p>
<br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../../Overview/Example.htm">Example</a>, <a href="../../../Types/IntRect.htm">IntRect</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,91 @@
<html>
<head>
<script type="text/javascript" src="../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ClipperBase</title>
<link rel="stylesheet" href="../../../../../Styles/default.css" type="text/css">
<meta name="Ancestor" content="">
<script type="text/javascript" src="../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../_Body.htm" class="Banner"><img src="../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperBase</h1>
<p class="Body"> <b>ClipperBase</b> is an abstract base class for <a href="../Clipper/_Body.htm"><b>Clipper</b></a>. A ClipperBase object should not be instantiated directly.</p>
<h2 id="Auto-Reference">Reference</h2>
<table>
<tr><th>Methods
</th>
</tr>
<tr>
<td colspan="1" class="White">In ClipperBase:
</td>
</tr>
<tr>
<td><a href="Methods/AddPath.htm">AddPath</a>
</td>
</tr>
<tr>
<td><a href="Methods/AddPaths.htm">AddPaths</a>
</td>
</tr>
<tr>
<td><a href="Methods/Clear.htm">Clear</a>
</td>
</tr>
<tr>
<td><a href="Methods/GetBounds.htm">GetBounds</a>
</td>
</tr>
</table>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Clipper/_Body.htm">Clipper</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,73 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>AddPath</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperOffset</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset.AddPath</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>procedure</b> AddPath(<b>const</b> Path: TPath; JoinType: TJoinType; EndType: TEndType);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> AddPath(<b>const</b> Path&amp; path, JoinType jointype, EndType endtype);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public void</b> AddPath(Path path, JoinType jointype, EndType endtype);</p>
<br>
<p class="Body"> Adds a <a href="../../../Types/Path.htm"><b>Path</b></a> to a ClipperOffset object in preparation for offsetting.<br><br> Any number of paths can be added, and each has its own <a href="../../../Types/JoinType.htm">JoinType</a> and <a href="../../../Types/EndType.htm">EndType</a>. All 'outer' Paths must have the same orientation, and any 'hole' paths must have reverse orientation. <em>Closed</em> paths must have at least 3 vertices. <em>Open</em> paths may have as few as one vertex. Open paths can only be offset with positive deltas.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../Types/EndType.htm">EndType</a>, <a href="../../../Types/JoinType.htm">JoinType</a>, <a href="../../../Types/Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,74 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>AddPaths</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperOffset</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset.AddPaths</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>procedure</b> AddPaths(<b>const</b> Paths: TPaths; JoinType: TJoinType; EndType: TEndType);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> AddPaths(<b>const</b> Paths&amp; paths, JoinType jointype, EndType endtype);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public void</b> AddPaths(Paths paths, JoinType jointype, EndType endtype);</p>
<br>
<p class="Body"> Adds <a href="../../../Types/Paths.htm"><b>Paths</b></a> to a ClipperOffset object in preparation for offsetting.<br><br> Any number of paths can be added, and each path has its own <a href="../../../Types/JoinType.htm">JoinType</a> and <a href="../../../Types/EndType.htm">EndType</a>. All 'outer' Paths must have the same orientation, and any 'hole' paths must have reverse orientation. <em>Closed</em> paths must have at least 3 vertices. <em>Open</em> paths may have as few as one vertex. Open paths can only be offset with positive deltas.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../Types/EndType.htm">EndType</a>, <a href="../../../Types/JoinType.htm">JoinType</a>, <a href="../../../Types/Paths.htm">Paths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,72 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Clear</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperOffset</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset.Clear</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>procedure</b> Clear;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> Clear();</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public void</b> Clear();</p>
<br>
<p class="Body"> This method clears all paths from the ClipperOffset object, allowing new paths to be assigned.<br><br> </p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,74 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Constructor</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperOffset</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset.Constructor</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>constructor</b> Create(MiterLimit: Double = 2; RoundPrecision: Double = 0.25);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> ClipperOffset( double miterLimit = 2.0, double roundPrecision = 0.25);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public</b> ClipperOffset( double miterLimit = 2.0, double roundPrecision = 0.25);</p>
<br>
<p class="Body"> The ClipperOffset constructor takes 2 optional parameters: <a href="../Properties/MiterLimit.htm">MiterLimit</a> and <a href="../Properties/ArcTolerance.htm">ArcTolerance</a>. Thes two parameters corresponds to properties of the same name. MiterLimit is only relevant when JoinType is jtMiter, and ArcTolerance is only relevant when JoinType is jtRound or when EndType is etOpenRound.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Properties/ArcTolerance.htm">ArcTolerance</a>, <a href="../Properties/MiterLimit.htm">MiterLimit</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,111 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Execute</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperOffset</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset.Execute</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>procedure</b> Execute(<b>out</b> solution: TPaths; Delta: Double); <b>overload</b>;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> Execute(Paths& solution, double delta);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public void</b> Execute(ref Paths solution, double delta);</p>
<br>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>procedure</b> Execute(<b>out</b> PolyTree: TPolyTree; Delta: Double); <b>overload</b>;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> Execute(PolyTree& polytree, double delta);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public void</b> Execute(ref PolyTree polytree, double delta);</p>
<br>
<p class="Body"> This method takes two parameters. The first is the structure that receives the result of the offset operation (either a PolyTree or a Paths structure). The second parameter is the amount to which the supplied paths will be offset. Negative delta values shrink polygons and positive delta expand them.<br><br> This method can be called multiple times, offsetting the same paths by different amounts (ie using different deltas).<br><br> <img src="../../../../../../Images/offset1.png" alt="" width="310" height="314" border="0" align="right">
<table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="560px">
<tr>
<td class="White">
<pre class="brush: cpp;">
#include "clipper.hpp"
...
using namespace ClipperLib;
int main()
{
Path subj;
Paths solution;
subj &lt;&lt;
IntPoint(348,257) &lt;&lt; IntPoint(364,148) &lt;&lt; IntPoint(362,148) &lt;&lt;
IntPoint(326,241) &lt;&lt; IntPoint(295,219) &lt;&lt; IntPoint(258,88) &lt;&lt;
IntPoint(440,129) &lt;&lt; IntPoint(370,196) &lt;&lt; IntPoint(372,275);
ClipperOffset co;
co.AddPath(subj, jtRound, etClosedPolygon);
co.Execute(solution, -7.0);
//draw solution ...
DrawPolygons(solution, 0x4000FF00, 0xFF009900);
}
</pre>
</td>
</tr>
</table> <div style="clear:both">&nbsp;</div> </p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,74 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ArcTolerance</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperOffset</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset.ArcTolerance</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> ArcTolerance: double; <span class="Comment">//read and write</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>double</b> ArcTolerance;</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public double</b> ArcTolerance {get; set;}</p>
<br>
<p class="Body"> Firstly, this field/property is only relevant when JoinType = jtRound and/or EndType = etRound.<br><br> Since flattened paths can never perfectly represent arcs, this field/property specifies a maximum acceptable imprecision ('tolerance') when arcs are approximated in an offsetting operation. Smaller values will increase 'smoothness' up to a point though at a cost of performance and in creating more vertices to construct the arc.<br><br> The default ArcTolerance is 0.25 units. This means that the maximum distance the flattened path will deviate from the 'true' arc will be no more than 0.25 units (before rounding).<br><br> <span class="maroon">Reducing tolerances below 0.25 will <b>not</b> improve smoothness since vertex coordinates will still be rounded to integer values.</span> The only way to achieve sub-integer precision is through coordinate scaling before and after offsetting (see example below).<br><br> <span class="maroon">It's important to make ArcTolerance a sensible fraction of the offset delta (arc radius)</span>. Large tolerances relative to the offset delta will produce poor arc approximations but, just as importantly, very small tolerances will substantially slow offsetting performance while providing unnecessary degrees of precision. This is most likely to be an issue when offsetting polygons whose coordinates have been scaled to preserve floating point precision.<br><br> <b>Example:</b> Imagine a set of polygons (defined in floating point coordinates) that is to be offset by 10 units using <em>round</em> joins, and the solution is to retain floating point precision up to at least 6 decimal places.<br> To preserve this degree of floating point precision, and given that Clipper and ClipperOffset both operate on integer coordinates, the polygon coordinates will be scaled up by 10<sup>8
</sup> (and rounded to integers) prior to offsetting. Both offset delta and ArcTolerance will also need to be scaled by this same factor. <em>If ArcTolerance was left unscaled at the default 0.25 units, every arc in the solution would contain a fraction of 44 THOUSAND vertices</em> while the final arc imprecision would be 0.25 &times; 10<sup>-8
</sup> units (ie once scaling was reversed). However, if 0.1 units was an acceptable imprecision in the final <em>unscaled</em> solution, then ArcTolerance should be set to 0.1 &times; scaling_factor (0.1 &times; 10<sup>8
</sup>). Now if scaling is applied equally to both ArcTolerance and to Delta Offset, then in this example the number of vertices (steps) defining each arc would be a fraction of 23.<br><br> The <a href="../../../../../../offset_triginometry2.svg">formula</a> for the number of steps in a full circular arc is ... Pi / acos(1 - arc_tolerance / abs(delta)) </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../../../offset_triginometry2.svg">offset_triginometry2</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,75 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>MiterLimit</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">ClipperOffset</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset.MiterLimit</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> MiterLimit: double; <span class="Comment">//read and write</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>double</b> MiterLimit;</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public double</b> MiterLimit {get; set;}</p>
<br>
<p class="Body"> This property sets the maximum distance <em>in multiples of delta</em> that vertices can be offset from their original positions before squaring is applied. (Squaring truncates a miter by 'cutting it off' at 1 &times; delta distance from the original vertex.)<br><br> <b>The default value for MiterLimit is 2</b> (ie twice delta). This is also the smallest MiterLimit that's allowed. If mitering was unrestricted (ie without any squaring), then offsets at very acute angles would generate unacceptably long 'spikes'.<br><br> An example of an offsetting 'spike' at a narrow angle that's a consequence of using a large MiterLimit (25) ...<br> <img src="../../../../../../Images/miterlimit.png" alt="" border="0"> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../Types/JoinType.htm">JoinType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,136 @@
<html>
<head>
<script type="text/javascript" src="../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ClipperOffset</title>
<link rel="stylesheet" href="../../../../../Styles/default.css" type="text/css">
<meta name="Ancestor" content="">
<script type="text/javascript" src="../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../_Body.htm" class="Banner"><img src="../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperOffset</h1>
<br>
<p class="Body">The ClipperOffset class encapsulates the process of offsetting (inflating/deflating) both open and closed paths using a number of different join types and end types.<br><br> <em>(This class replaces the now deprecated OffsetPaths function which was less flexible.)</em><br><br> <b>Preconditions for offsetting:</b><br> 1. The orientations of closed paths must be consistent such that outer polygons share the same orientation, and any holes have the opposite orientation (ie non-zero filling). Open paths must be oriented with closed outer polygons.<br> 2. Polygons must not self-intersect. <br><br> <b>Limitations:</b><br> When offsetting, small artefacts may appear where polygons overlap. To avoid these artefacts, offset overlapping polygons separately.<br><br><br> <img src="../../../../../Images/offset1.png" alt="" width="310" height="314" border="0" align="right">
<table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="560px">
<tr>
<td class="White">
<pre class="brush: cpp;">
#include "clipper.hpp"
...
using namespace ClipperLib;
int main()
{
Path subj;
Paths solution;
subj &lt;&lt;
IntPoint(348,257) &lt;&lt; IntPoint(364,148) &lt;&lt; IntPoint(362,148) &lt;&lt;
IntPoint(326,241) &lt;&lt; IntPoint(295,219) &lt;&lt; IntPoint(258,88) &lt;&lt;
IntPoint(440,129) &lt;&lt; IntPoint(370,196) &lt;&lt; IntPoint(372,275);
ClipperOffset co;
co.AddPath(subj, jtRound, etClosedPolygon);
co.Execute(solution, -7.0);
//draw solution ...
DrawPolygons(solution, 0x4000FF00, 0xFF009900);
}
</pre>
</td>
</tr>
</table> <div style="clear:both">&nbsp;</div> </p>
<h2 id="Auto-Reference">Reference</h2>
<table>
<tr><th>Methods
</th><th>Properties
</th>
</tr>
<tr>
<td colspan="2" class="White">In ClipperOffset:
</td>
</tr>
<tr>
<td><a href="Methods/AddPath.htm">AddPath</a>
</td>
<td><a href="Properties/ArcTolerance.htm">ArcTolerance</a>
</td>
</tr>
<tr>
<td><a href="Methods/AddPaths.htm">AddPaths</a>
</td>
<td><a href="Properties/MiterLimit.htm">MiterLimit</a>
</td>
</tr>
<tr>
<td><a href="Methods/Clear.htm">Clear</a>
</td>
<td>
</td>
</tr>
<tr>
<td><a href="Methods/Constructor.htm">Constructor</a>
</td>
<td>
</td>
</tr>
<tr>
<td><a href="Methods/Execute.htm">Execute</a>
</td>
<td>
</td>
</tr>
</table>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,97 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>GetNext</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyNode</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode.GetNext</h1>
<p class="Decl"><span class="Comment"> Del.&raquo; </span><b>function</b> GetNext: TPolyNode;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> PolyNode* GetNext();</p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public <span class="CSharp">PolyNode</span></b> GetNext();</p>
<p class="Body"> The returned Polynode will be the first child if any, otherwise the next sibling, otherwise the next sibling of the Parent etc.<br><br> A PolyTree can be traversed very easily by calling GetFirst() followed by GetNext() in a loop until the returned object is a null pointer ...<br><br>
<table cellspacing="0" cellpadding="0" border="0" align="left" style="margin: 0;" width="600px">
<tr>
<td class="White">
<pre class="brush: cpp;">
PolyTree polytree;
//call to Clipper.Execute method here which fills 'polytree'
PolyNode* polynode = polytree.GetFirst();
while (polynode)
{
//do stuff with polynode here
polynode = polynode-&gt;GetNext();
}
</pre>
</td>
</tr>
</table> <div style="clear:both;"></div> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../PolyTree/Methods/GetFirst.htm">PolyTree.GetFirst</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,74 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ChildCount</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyNode</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode.ChildCount</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> ChildCount: Integer; <span class="Comment">//read only</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> ChildCount(); <span class="Comment">//read only</span></p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <span class="CSharp"><b>public int</b></span> ChildCount; <span class="Comment">//read only</span></p>
<br>
<p class="Body"> Returns the number of PolyNode <a href="./Childs.htm">Childs</a> directly owned by the PolyNode object. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="Childs.htm">Childs</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,75 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Childs</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyNode</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode.Childs</h1>
<p class="Decl"><span class="Comment"> Del.&raquo; </span><b>property</b> Childs[index: Integer]: TPolyNode; <span class="Comment">//read only</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> std<b>::</b>vector &lt; PolyNode* &gt; Childs;<span class="Comment">//public field</span></p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public <span class="CSharp"> List </span>&lt; <span class="CSharp">PolyNode</span> &gt;</b> Childs; <span class="Comment">//read only property</span></p>
<p class="Body"> A read-only list of PolyNode.<br> Outer PolyNode childs contain hole PolyNodes, and hole PolyNode childs contain nested outer PolyNodes. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="ChildCount.htm">ChildCount</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,69 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Contour</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyNode</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode.Contour</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> Contour: TPath; <span class="Comment">//read only</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> Path Contour; <span class="Comment">//public field</span></p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public <span class="CSharp">Path</span></b> Contour; <span class="Comment">//read only property</span></p>
<p class="Body"> Returns a path list which contains any number of vertices.<br><br> </p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,72 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>IsHole</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyNode</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode.IsHole</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> IsHole: Boolean; <span class="Comment">//read only</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> bool IsHole; <span class="Comment">//field</span></p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public <span class="CSharp">bool</span></b> IsHole; <span class="Comment">//read only property</span></p>
<p class="Body"> Returns true when the PolyNode's polygon (<a href="./Contour.htm">Contour</a>) is a <a href="../../../../../Overview/_Body.htm#terminology">hole</a>.<br><br> Children of <em>outer</em> polygons are always <em>holes</em>, and children of <em>holes</em> are always (nested) <em>outer</em> polygons.<br> The IsHole property of a <a href="../../PolyTree/_Body.htm">PolyTree</a> object is undefined but its children are always top-level <em>outer</em> polygons. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../../Overview/_Body.htm">Overview</a>, <a href="Contour.htm">Contour</a>, <a href="../../PolyTree/_Body.htm">PolyTree</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,72 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>IsOpen</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyNode</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode.IsOpen</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> IsOpen: Boolean; <span class="Comment">//read only</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> bool IsOpen; <span class="Comment">//field</span></p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public <span class="CSharp">bool</span></b> IsOpen; <span class="Comment">//read only property</span></p>
<p class="Body"> Returns true when the PolyNode's <a href="./Contour.htm">Contour</a> results from a clipping operation on an open contour (path). Only top-level PolyNodes can contain open contours.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="Contour.htm">Contour</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,69 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Parent</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyNode</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode.Parent</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> Parent: TPolyNode; <span class="Comment">//read only</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> PolyNode* Parent; <span class="Comment">//field</span></p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public <span class="CSharp">PolyNode</span></b> Parent; <span class="Comment">//read only property</span></p>
<p class="Body"> Returns the parent PolyNode.<br><br> The PolyTree object (which is also a PolyNode) does not have a parent and will return a null pointer. </p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,125 @@
<html>
<head>
<script type="text/javascript" src="../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>PolyNode</title>
<link rel="stylesheet" href="../../../../../Styles/default.css" type="text/css">
<meta name="Ancestor" content="">
<script type="text/javascript" src="../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../_Body.htm" class="Banner"><img src="../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyNode</h1>
<br>
<p class="Body"> <b>PolyNodes</b> are encapsulated within a <a href="../PolyTree/_Body.htm"><b>PolyTree</b></a> container, and together provide a data structure representing the parent-child relationships of polygon contours returned by Clipper's <a href="../Clipper/Methods/Execute.htm"><b>Execute</b></a> method.<br><br> A <b>PolyNode</b> object represents a single polygon. Its <a href="./Properties/IsHole.htm">IsHole</a> property indicates whether it's an <a href="../../../../Overview/_Body.htm#terminology">outer</a> or a <a href="../../../../Overview/_Body.htm#terminology">hole</a>. PolyNodes may own any number of PolyNode children (<a href="./Properties/Childs.htm"><b>Childs</b></a>), where children of outer polygons are holes, and children of holes are (nested) outer polygons.<br><br> </p>
<h2 id="Auto-Reference">Reference</h2>
<table>
<tr><th>Fields
</th><th>Methods
</th><th>Properties
</th>
</tr>
<tr>
<td colspan="2" class="White">In PolyNode:
</td>
</tr>
<tr>
<td>
</td>
<td><a href="Methods/GetNext.htm">GetNext</a>
</td>
<td><a href="Properties/ChildCount.htm">ChildCount</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Properties/Childs.htm">Childs</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Properties/Contour.htm">Contour</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Properties/IsHole.htm">IsHole</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Properties/IsOpen.htm">IsOpen</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Properties/Parent.htm">Parent</a>
</td>
</tr>
</table>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../Overview/_Body.htm">Overview</a>, <a href="../Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="../PolyTree/_Body.htm">PolyTree</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,73 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Clear</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyTree</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyTree.Clear</h1>
<p class="Decl"><span class="Comment"> Del.&raquo; </span><b>procedure</b> Clear;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> Clear();</p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public void</b> Clear();</p>
<br>
<p class="Body"> This method clears any PolyNode children contained by PolyTree the object.<br><br> <b>Clear</b> does <em>not</em> need to be called explicitly. The <a href="../../Clipper/Methods/Execute.htm">Clipper.Execute</a> method that accepts a PolyTree parameter will <em>automatically</em> clear the PolyTree object before propagating it with new PolyNodes. Likewise, PolyTree's destructor will also automatically clear any contained PolyNodes. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../Clipper/Methods/Execute.htm">Clipper.Execute</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,77 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>GetFirst</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyTree</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyTree.GetFirst</h1>
<p class="Decl"><span class="Comment"> Del.&raquo; </span><b>function</b> GetFirst: TPolyNode;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> PolyNode* GetFirst();</p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <b>public <span class="CSharp">PolyNode</span></b> GetFirst();</p>
<p class="Body"> This method returns the first outer polygon contour if any, otherwise a null pointer.<br><br> This function is almost equivalent to calling Childs[0] except that when a PolyTree object is empty (has no children), calling Childs[0] would raise an out of range exception. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../PolyNode/Methods/GetNext.htm">PolyNode.GetNext</a>, <a href="../../PolyNode/Properties/ChildCount.htm">PolyNode.ChildCount</a>, <a href="../../PolyNode/Properties/Childs.htm">PolyNode.Childs</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,74 @@
<html>
<head>
<script type="text/javascript" src="../../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Total</title>
<link rel="stylesheet" href="../../../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../../../Images/_Class.gif" align="absmiddle">PolyTree</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyTree.Total</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>property</b> Total: Integer; <span class="Comment">//read only</span></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> Total(); <span class="Comment">//read only</span></p>
<p class="Decl3"><span class="Comment"> C#&nbsp;&nbsp;&raquo;</span> <span class="CSharp"><b>public int</b></span> Total; <span class="Comment">//read only</span></p>
<br>
<p class="Body"> Returns the total number of PolyNodes (polygons) contained within the PolyTree. This value is not to be confused with <a href="../../PolyNode/Properties/ChildCount.htm">ChildCount</a> which returns the number of immediate children only (<a href="../../PolyNode/Properties/Childs.htm">Childs</a>) contained by PolyTree. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../PolyNode/Properties/ChildCount.htm">PolyNode.ChildCount</a>, <a href="../../PolyNode/Properties/Childs.htm">PolyNode.Childs</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,189 @@
<html>
<head>
<script type="text/javascript" src="../../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>PolyTree</title>
<link rel="stylesheet" href="../../../../../Styles/default.css" type="text/css">
<meta name="Ancestor" content="PolyNode">
<script type="text/javascript" src="../../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../../_Body.htm" class="Banner"><img src="../../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyTree</h1>
<h2>Hierarchy</h2>
<p class="Hierarchy"></p>
<p class="Hierarchy">&nbsp;&nbsp;&nbsp;|</p>
<p class="Hierarchy"><a href="../PolyNode/_Body.htm">PolyNode</a></p>
<br>
<p class="Body"> <b>PolyTree</b> is intended as a <b>read-only</b> data structure that should only be used to receive <em>solutions</em> from clipping and offsetting operations. It's an alternative to the <a href="../../Types/Paths.htm">Paths</a> data structure which also receives these solutions. PolyTree's two major advantages over the <em>Paths</em> structure are: it properly represents the <b>parent-child relationships</b> of the returned polygons; it differentiates between <b>open</b> and <b>closed</b> paths. However, since PolyTree is a more complex structure than the <em>Paths</em> structure, and since it's more computationally expensive to process (the Execute method being roughly 5-10% slower), <span class="maroon">it should used only be when parent-child polygon relationships are needed, or when open paths are being 'clipped'.</span><br><br> An empty PolyTree object can be passed as the <em>solution</em> parameter in <a href="../Clipper/Methods/Execute.htm"><b>Clipper.Execute</b></a> and in <a href="../ClipperOffset/Methods/Execute.htm"><b>ClipperOffset.Execute</b></a>. Once the clipping or offseting operation is completed, the method returns with the PolyTree structure filled with data representing the solution.<br><br> A <b>PolyTree</b> object is a container for any number of <a href="../PolyNode/_Body.htm"><b>PolyNode</b></a> children, with each contained PolyNode representing a single polygon contour (either an <a href="../../../../Overview/_Body.htm#terminology">outer</a> or <a href="../../../../Overview/_Body.htm#terminology">hole</a> polygon). <span class="maroon">PolyTree itself is a specialized PolyNode whose immediate children represent the top-level <em>outer</em> polygons of the solution. (Its own <a href="../PolyNode/Properties/Contour.htm">Contour</a> property is always empty.)</span> The contained top-level PolyNodes may contain their own PolyNode children representing hole polygons that may also contain children representing nested outer polygons etc. Children of <em>outers</em> will always be <em>holes</em>, and children of <em>holes</em> will always be <em>outers</em>.<br><br> <b>PolyTrees</b> can also contain <b>open</b> paths. Open paths will always be represented by <em>top level</em> PolyNodes. Two functions are provided to quickly separate out <em>open</em> and <em>closed</em> paths from a polytree - <a href="../../Functions/OpenPathsFromPolyTree.htm"><b>OpenPathsFromPolyTree</b></a> and <a href="../../Functions/ClosedPathsFromPolyTree.htm"><b>ClosedPathsFromPolyTree</b></a>. <br><br> <div align="left">
<table cellspacing="2" cellpadding="0" border="0">
<tr>
<td style="background-color: #FFFFFF;">
<img src="../../../../../Images/polytree.png" alt="" border="0">
</td>
<td style="background-color: #FFFFFF;">
<pre style="font-family: Verdana, Arial, Helvetica, sans-serif;">
<b>polytree:</b>
Contour = <b>()</b>
ChildCount = <b>1</b>
Childs[0]:
Contour = ((10,10),(100,10),(100,100),(10,100))
IsHole = <b>False</b>
ChildCount = <b>1</b>
Childs[0]:
Contour = ((20,20),(20,90),(90,90),(90,20))
IsHole = <b>True</b>
ChildCount = <b>2</b>
Childs[0]:
Contour = ((30,30),(50,30),(50,50),(30,50))
IsHole = <b>False</b>
ChildCount = <b>0</b>
Childs[1]:
Contour = ((60,60),(80,60),(80,80),(60,80))
IsHole = <b>False</b>
ChildCount = <b>0</b>
</pre>
</td>
</tr>
</table> </div> </p>
<h2 id="Auto-Reference">Reference</h2>
<table>
<tr><th>Fields
</th><th>Methods
</th><th>Properties
</th>
</tr>
<tr>
<td colspan="2" class="White">In PolyTree:
</td>
</tr>
<tr>
<td>
</td>
<td><a href="Methods/Clear.htm">Clear</a>
</td>
<td><a href="Properties/Total.htm">Total</a>
</td>
</tr>
<tr>
<td>
</td>
<td><a href="Methods/GetFirst.htm">GetFirst</a>
</td>
<td>
</td>
</tr>
<tr>
<td colspan="2" class="White">In PolyNode:
</td>
</tr>
<tr>
<td>
</td>
<td><a href="../PolyNode/Methods/GetNext.htm">GetNext</a>
</td>
<td><a href="../PolyNode/Properties/ChildCount.htm">ChildCount</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="../PolyNode/Properties/Childs.htm">Childs</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="../PolyNode/Properties/Contour.htm">Contour</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="../PolyNode/Properties/IsHole.htm">IsHole</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="../PolyNode/Properties/IsOpen.htm">IsOpen</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="../PolyNode/Properties/Parent.htm">Parent</a>
</td>
</tr>
</table>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../../Overview/_Body.htm">Overview</a>, <a href="../Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="../ClipperOffset/Methods/Execute.htm">ClipperOffset.Execute</a>, <a href="../PolyNode/_Body.htm">PolyNode</a>, <a href="../../Functions/ClosedPathsFromPolyTree.htm">ClosedPathsFromPolyTree</a>, <a href="../../Functions/OpenPathsFromPolyTree.htm">OpenPathsFromPolyTree</a>, <a href="../../Types/Paths.htm">Paths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,72 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Area</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Area</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> Area(<b>const</b> pts: <a href="../Types/Path.htm">TPath</a>): double;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>double</b> Area(<b>const</b> <a href="../Types/Path.htm">Path</a> &amp;poly);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static double</b> Area(<a href="../Types/Path.htm">Path</a> poly);</p>
<p class="Body">This function returns the area of the supplied polygon. It's assumed that the path is closed and does not self-intersect. Depending on <a href="./Orientation.htm">orientation</a>, this value may be positive or negative. If Orientation is true, then the area will be positive and conversely, if Orientation is false, then the area will be negative.</p>
<br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="Orientation.htm">Orientation</a>, <a href="../Types/Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,88 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>CleanPolygon</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>CleanPolygon</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> CleanPolygon(<b>const</b> Poly: TPath; Distance: double = 1.415): TPath;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> CleanPolygon(<b>const</b> Path &amp;in_poly, Path &amp;out_poly, double distance = 1.415);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> CleanPolygon(Path &amp;poly, double distance = 1.415);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Path CleanPolygon(Path poly, double distance = 1.415);</p>
<br>
<p class="Body"> Removes vertices:
<ul>
<li>that join co-linear edges, or join edges that are almost co-linear (such that if the vertex was moved no more than the specified distance the edges would be co-linear)</li>
<li>that are within the specified distance of an adjacent vertex</li>
<li>that are within the specified distance of a semi-adjacent vertex together with their out-lying vertices</li>
</ul> </p>
<p class="Body"> Vertices are <em>semi-adjacent</em> when they are separated by a single (out-lying) vertex.<br><br> The <em>distance</em> parameter's default value is approximately &radic;2 so that a vertex will be removed when adjacent or semi-adjacent vertices having their corresponding X and Y coordinates differing by no more than 1 unit. (If the egdes are semi-adjacent the out-lying vertex will be removed too.)<br><br> C++ only: This function is overloaded. In the first definition, the <em>in_poly</em> and <em>out_poly</em> parameters can reference the same <em>Path</em> object though in that case the calling code might be clearer if the second definition (accepting a single <em>Paths</em> parameter) is used.<br><br> <img src="../../../../Images/clean1.png" alt="" border="0">&nbsp;&nbsp;&nbsp; <img src="../../../../Images/clean2.png" alt="" border="0"> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="CleanPolygons.htm">CleanPolygons</a>, <a href="SimplifyPolygon.htm">SimplifyPolygon</a>, <a href="../Types/Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,87 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>CleanPolygons</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>CleanPolygons</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> CleanPolygons(<b>const</b> Polys: TPaths; Distance: double = 1.415): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> CleanPolygons(<b>const</b> Paths &amp;in_polys, Paths &amp;out_polys, double distance = 1.415);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> CleanPolygons(Paths &amp;polys, double distance = 1.415);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Paths CleanPolygons(Paths polys, double distance = 1.415);</p>
<br>
<p class="Body"> Removes vertices:
<ul>
<li>that join co-linear edges, or join edges that are almost co-linear (such that if the vertex was moved no more than the specified distance the edges would be co-linear)</li>
<li>that are within the specified distance of an adjacent vertex</li>
<li>that are within the specified distance of a semi-adjacent vertex together with their out-lying vertices</li>
</ul> </p>
<p class="Body"> Vertices are <em>semi-adjacent</em> when they are separated by a single (out-lying) vertex.<br><br> The <em>distance</em> parameter's default value is approximately &radic;2 so that a vertex will be removed when adjacent or semi-adjacent vertices having their corresponding X and Y coordinates differing by no more than 1 unit. (If the egdes are semi-adjacent the out-lying vertex will be removed too.)<br><br> C++ only: This function is overloaded. In the first definition, the <em>in_polys</em> and <em>out_polys</em> parameters can reference the same <em>Paths</em> object though in that case the calling code might be clearer if the second definition (accepting a single <em>Paths</em> parameter) is used.<br><br> <img src="../../../../Images/clean1.png" alt="" border="0">&nbsp;&nbsp;&nbsp; <img src="../../../../Images/clean2.png" alt="" border="0"> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="CleanPolygon.htm">CleanPolygon</a>, <a href="SimplifyPolygons.htm">SimplifyPolygons</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,71 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ClosedPathsFromPolyTree</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClosedPathsFromPolyTree</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> ClosedPathsFromPolyTree(PolyTree: TPolyTree): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> ClosedPathsFromPolyTree(PolyTree& polytree, Paths& paths);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static void</b> ClosedPathsFromPolyTree(PolyTree polytree, Paths paths);</p>
<br>
<p class="Body"> This function filters out <em>open</em> paths from the <a href="../Classes/PolyTree/_Body.htm"><b>PolyTree</b></a> structure and returns only <em>closed</em> paths in a <a href="../Types/Paths.htm"><b>Paths</b></a> structure. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/PolyTree/_Body.htm">PolyTree</a>, <a href="../Types/Paths.htm">Paths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,74 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>MinkowskiDiff</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>MinkowskiDiff</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> MinkowskiDiff(<b>const</b> Poly1: TPath; <b>const</b> Poly2: TPath): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> MinkowskiDiff(<b>const</b> Path& poly1, <b>const</b> Path& poly2, Paths& solution);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Paths MinkowskiDiff(Path poly1, Path poly2);</p>
<br>
<p class="Body"> <img src="../../../../Images/minkowski2.png" alt="" border="0" align="right"> <b>Minkowski Difference</b> is performed by <em>subtracting</em> each point in a polygon from the set of points in an open or closed path. A key feature of Minkowski Difference is that when it's applied to two polygons, the resulting polygon will contain the coordinate space origin whenever the two polygons touch or overlap. (This function is often used to determine when polygons collide.)<br><br> <em>In the image on the left the blue polygon is the 'minkowski difference' of the two red boxes. The black dot represents the coordinate space origin.</em> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="MinkowskiSum.htm">MinkowskiSum</a>, <a href="../Types/Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,101 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>MinkowskiSum</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>MinkowskiSum</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> MinkowskiSum(<b>const</b> Pattern: TPath; <b>const</b> Path: TPath; PathIsClosed: Boolean): TPaths; <b>overload;</b></p>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> MinkowskiSum(<b>const</b> Pattern: TPath; <b>const</b> Paths: TPaths; PathFillType: TPolyFillType; PathIsClosed: Boolean): TPaths; <b>overload;</b></p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> MinkowskiSum(<b>const</b> Path& pattern, <b>const</b> Path& path, Paths& solution, <b>bool</b> pathIsClosed);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> MinkowskiSum(<b>const</b> Path& pattern, <b>const</b> Paths& paths, Paths& solution, PolyFillType pathFillType, <b>bool</b> pathIsClosed);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Paths MinkowskiSum(Path pattern, Path path, <b>bool</b> pathIsClosed);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Paths MinkowskiSum(Path pattern, Paths paths, PolyFillType pathFillType, <b>bool</b> pathIsClosed);</p>
<br>
<p class="Body"> <b>Minkowski Addition</b> is performed by <em>adding</em> each point in a polygon 'pattern' to the set of points in an open or closed path. The resulting polygon (or polygons) defines the region that the 'pattern' would pass over in moving from the beginning to the end of the 'path'. </p>
<p class="Body"> <img src="../../../../Images/minkowski.png" alt="" border="0" align="right">
<pre class="brush: csharp;">
Path path = new Path();
Path pattern = new Path();
Paths solution = new Paths();
//Greek capital sigma (sum sign) ...
Int64[] ints1 = new Int64[] { 300, 400, 100, 400, 200, 300, 100, 200, 300, 200 };
path = IntsToPolygon(ints1);
//diagonal brush pattern ...
Int64[] ints2 = new Int64[] { 4, -6, 6, -6, -4, 6, -6, 6 };
pattern = IntsToPolygon(ints2);
solution = Clipper.MinkowskiSum(pattern, path, false);
//move 'pattern' to the end of 'path' ...
pattern = TranslatePath(pattern, 300, 200);
//Display solution &plusmn; pattern ...
</pre> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="MinkowskiDiff.htm">MinkowskiDiff</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,70 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>OffsetPaths</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>OffsetPaths</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> OffsetPaths(<b>const</b> polys: Paths; <b>const</b> delta: double; JoinType: TJoinType = jtSquare; EndType: TEndType = etClosed; Limit: double = 0.0): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> OffsetPaths(<b>const</b> Paths &amp;in_polys, Paths &amp;out_polys, <b>double</b> delta, JoinType jointype = jtSquare, EndType endtype = etClosed, <b>double</b> limit = 0.0);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Paths OffsetPaths(Paths polys, <b>double</b> delta, JoinType jointype = JoinType.jtSquare, EndType endtype = EndType.etClosed, <b>double</b> limit = 0.0);</p>
<br>
<p class="Body"> <b>Deprecated.</b> (See <a href="../Classes/ClipperOffset/_Body.htm">ClipperOffset</a>.)<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/ClipperOffset/_Body.htm">ClipperOffset</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,71 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>OpenPathsFromPolyTree</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>OpenPathsFromPolyTree</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> OpenPathsFromPolyTree(PolyTree: TPolyTree): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> OpenPathsFromPolyTree(PolyTree& polytree, Paths& paths);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static void</b> OpenPathsFromPolyTree(PolyTree polytree, Paths paths);</p>
<br>
<p class="Body"> This function filters out <em>closed</em> paths from the <a href="../Classes/PolyTree/_Body.htm"><b>PolyTree</b></a> structure and returns only <em>open</em> paths in a <a href="../Types/Paths.htm"><b>Paths</b></a> structure. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/PolyTree/_Body.htm">PolyTree</a>, <a href="../Types/Paths.htm">Paths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,92 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Orientation</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Orientation</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> Orientation(<b>const</b> poly: <a href="../Types/Path.htm">TPath</a>): boolean;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>bool</b> Orientation(<b>const</b> <a href="../Types/Path.htm">Path</a> &amp;poly); <span class="Comment">// Function in the ClipperLib namespace.</span></p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static bool</b> Orientation(<a href="../Types/Path.htm">Path</a> poly); <span class="Comment">// Static method of the Clipper class in the ClipperLib namespace.</span></p>
<p class="Body">Orientation is only important to <em>closed</em> paths. Given that vertices are declared in a specific order, orientation refers to the direction (clockwise or counter-clockwise) that these vertices progress around a closed path.<br><br> Orientation is also dependent on axis direction:<br>
<ul>
<li>On <b>Y-axis positive <em>upward</em> displays</b>, Orientation will return true if the polygon's orientation is counter-clockwise.</li>
<li>On <b>Y-axis positive <em>downward</em> displays</b>, Orientation will return true if the polygon's orientation is clockwise.</li>
</ul> </p>
<p class="Body"> <img src="../../../../Images/orientation.png" alt="" border="0" align="left"><br style="clear:both"><br> <b>Notes:</b><br>
<ul>
<li>Self-intersecting polygons have indeterminate orientations in which case this function won't return a meaningful value.</li>
<li>The majority of 2D graphic display libraries (eg GDI, GDI+, XLib, Cairo, AGG, Graphics32) and even the SVG file format have their coordinate origins at the top-left corner of their respective viewports <em>with their Y axes increasing downward</em>. However, some display libraries (eg Quartz, OpenGL) have their coordinate origins undefined or in the classic bottom-left position with their Y axes increasing upward.</li>
<li>For Non-Zero filled polygons, the orientation of <a href="../../../Overview/_Body.htm#terminology">holes</a> <em>must be opposite</em> that of <a href="../../../Overview/_Body.htm#terminology">outer</a> polygons.</li>
<li>For closed paths (polygons) in the <em>solution</em> returned by Clipper's Execute method, their orientations will always be <em>true</em> for outer polygons and <em>false</em> for hole polygons (unless the <a href="../Classes/Clipper/Properties/ReverseSolution.htm"><b>ReverseSolution</b></a> property has been enabled).</li>
</ul> </p>
<br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../Overview/_Body.htm">Overview</a>, <a href="../Classes/Clipper/Properties/ReverseSolution.htm">Clipper.ReverseSolution</a>, <a href="../Types/Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,72 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>PointInPolygon</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PointInPolygon</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> PointInPolygon(<b>const</b> Pt: <a href="../Types/IntPoint.htm">TIntPoint</a>; <b>const</b> poly: <a href="../Types/Path.htm">TPath</a>): Integer;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>int</b> PointInPolygon(<b>const</b> <a href="../Types/IntPoint.htm">IntPoint</a> pt, <b>const</b> <a href="../Types/Path.htm">Path</a> &amp;poly); <span class="Comment">// Function in the ClipperLib namespace.</span></p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static int</b> PointInPolygon(<a href="../Types/IntPoint.htm">IntPoint</a> pt, <a href="../Types/Path.htm">Path</a> poly); <span class="Comment">// Static method of the Clipper class.</span></p>
<p class="Body">Returns 0 when false, -1 when pt is <b>on</b> poly and +1 when pt is <b>in</b> poly.<br><br> It's assumed that 'poly' is closed and does not self-intersect. </p>
<br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Types/IntPoint.htm">IntPoint</a>, <a href="../Types/Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,71 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>PolyTreeToPaths</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyTreeToPaths</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> PolyTreeToPaths(PolyTree: TPolyTree): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> PolyTreeToPaths(PolyTree& polytree, Paths& paths);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Paths PolyTreeToPaths(PolyTree polytree);</p>
<br>
<p class="Body"> This function converts a <a href="../Classes/PolyTree/_Body.htm"><b>PolyTree</b></a> structure into a <a href="../Types/Paths.htm"><b>Paths</b></a> structure. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/PolyTree/_Body.htm">PolyTree</a>, <a href="../Types/Paths.htm">Paths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,71 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ReversePath</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ReversePath</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> ReversePath(<b>const</b> polys: TPath): TPath;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> ReversePath(<b>const</b> Path &amp;p);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo; //Call Path.Reverse().</span></p>
<br>
<p class="Body"> Reverses the vertex order (and hence orientation) in the specified path. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Types/Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,70 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ReversePaths</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ReversePaths</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> ReversePaths(<b>const</b> p: TPaths): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> ReversePaths(<b>const</b> Paths &amp;p);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>void</b> ReversePaths( Paths p );</p>
<br>
<p class="Body"> Reverses the vertex order (and hence orientation) in each contained path. </p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,75 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>SimplifyPolygon</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>SimplifyPolygon</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> SimplifyPolygon(<b>const</b> Poly: TPath; FillType: TPolyFillType = pftEvenOdd): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> SimplifyPolygon(<b>const</b> Path &amp;in_poly, Paths &amp;out_polys, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PolyFillType fillType = pftEvenOdd);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Paths SimplifyPolygon(Path poly, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PolyFillType fillType = PolyFillType.pftEvenOdd);</p>
<br>
<p class="Body"> Removes self-intersections from the supplied polygon (by performing a boolean <em>union</em> operation using the nominated <a href="../Types/PolyFillType.htm">PolyFillType</a>).<br> Polygons with non-contiguous duplicate vertices (ie 'touching') will be split into two polygons.<br><br> <em>Note: There's currently no guarantee that polygons will be strictly simple since 'simplifying' is still a work in progress.</em><br><br> <img src="../../../../Images/simplify.png" alt="" border="0"><br> <img src="../../../../Images/simplify2.png" alt="" border="0"> <img src="../../../../Images/simplify3.png" alt="" border="0"> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/Clipper/Properties/StrictlySimple.htm">Clipper.StrictlySimple</a>, <a href="CleanPolygon.htm">CleanPolygon</a>, <a href="../Types/Path.htm">Path</a>, <a href="../Types/PolyFillType.htm">PolyFillType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,76 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>SimplifyPolygons</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>SimplifyPolygons</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>function</b> SimplifyPolygons(<b>const</b> polys: TPaths; <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;FillType: TPolyFillType = pftEvenOdd): TPaths;</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> SimplifyPolygons(<b>const</b> Paths &amp;in_polys, Paths &amp;out_polys, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PolyFillType fillType = pftEvenOdd);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>void</b> SimplifyPolygons(Paths &amp;polys, PolyFillType fillType = pftEvenOdd);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public static</b> Polygons SimplifyPolygons(Paths polys, <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;PolyFillType fillType = PolyFillType.pftEvenOdd);</p>
<br>
<p class="Body"> Removes self-intersections from the supplied polygons (by performing a boolean <em>union</em> operation using the nominated <a href="../Types/PolyFillType.htm">PolyFillType</a>).<br> Polygons with non-contiguous duplicate vertices (ie 'vertices are touching') will be split into two polygons.<br><br> C++ only: This function is overloaded. In the first definition, the <em>in_polys</em> and <em>out_polys</em> parameters can reference the same <em>Paths</em> object though in that case the calling code might be clearer if the second definition (accepting a single <em>Paths</em> parameter) is used.<br><br> <em>Note: There's currently no guarantee that polygons will be strictly simple since 'simplifying' is still a work in progress.</em><br><br> <img src="../../../../Images/simplify.png" alt="" border="0"><br> <img src="../../../../Images/simplify2.png" alt="" border="0"> <img src="../../../../Images/simplify3.png" alt="" border="0"> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/Clipper/Properties/StrictlySimple.htm">Clipper.StrictlySimple</a>, <a href="CleanPolygons.htm">CleanPolygons</a>, <a href="../Types/PolyFillType.htm">PolyFillType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,70 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>CInt</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>CInt</h1>
<p class="Decl">Del.&raquo;<br> {$IFDEF use_int32}<br> &nbsp;cInt = Int32;<br> {$ELSE}<br> &nbsp;&nbsp;cInt = Int64;<br> {$ENDIF}<br> </p>
<p class="Decl2">C++&nbsp;&raquo;<br> #ifdef use_int32<br> &nbsp;&nbsp;typedef int cInt;<br> #else<br> &nbsp;&nbsp;typedef signed long long cInt;<br> #endif </p>
<p class="Decl3">C#&nbsp;&nbsp;&raquo;<br> #if use_int32<br> &nbsp;&nbsp;using cInt = Int32;<br> #else<br> &nbsp;&nbsp;using cInt = Int64;<br> #endif </p>
<p class="Body"> <b>cInt</b> is the integer type used by the Clipper Library to represent vertex coordinate values. (See also <a href="./IntPoint.htm">IntPoint</a>.)<br><br> The library uses integers instead of floating point values to preserve <a href="http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf" target="_blank">numerical robustness</a>. (Very early versions of the library used floating point coordinates, but it became apparent that floating point imprecision was always going to cause occasional errors.)<br><br> By default <b>cInt</b> represents a signed 64bit integer and polygon coordinates can have any value in the range &plusmn; 9.2e+18. This accommodates the scaling of floating point coordinate values to very large integers so that very high degrees of precision can be retained during clipping. However, if coordinate values can be kept within the range &plusmn; 3.0e+9, then by avoiding large integer math, a modest ~10% improvement in clipping performance is achieved.<br><br> If the preprocessor directive <a href="../PreProcessor/Defines.htm"><b>use_int32</b></a> is defined, cInt will represent a signed 32bit integer. This improves clipping performance by 20-30% but the trade-off is that coordinate values are restricted to the much narrower range of &plusmn; 46340. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../PreProcessor/Defines.htm">Defines</a>, <a href="IntPoint.htm">IntPoint</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,100 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ClipType</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipType</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TClipType = (ctIntersection, ctUnion, ctDifference, ctXor);</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>enum </b>ClipType { ctIntersection, ctUnion, ctDifference, ctXor };</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public enum</b> ClipType { ctIntersection, ctUnion, ctDifference, ctXor };</p>
<br>
<p class="Body"> There are four boolean operations - AND, OR, NOT &amp; XOR.<br><br> Given that subject and clip polygon brush 'filling' is defined both by their vertices and their respective <a href="./PolyFillType.htm">filling rules</a>, the four boolean operations can be applied to polygons to define new filling regions:
<ul>
<li>AND (intersection) - create regions where both subject <b>and</b> clip polygons are filled</li>
<li>OR (union) - create regions where <b>either</b> subject <b>or</b> clip polygons (or both) are filled</li>
<li>NOT (difference) - create regions where subject polygons are filled <b>except</b> where clip polygons are filled</li>
<li>XOR (exclusive or) - create regions where <b>either</b> subject <b>or</b> clip polygons are filled <b>but not</b> where <b>both</b> are filled</li>
</ul> <br> </p>
<p class="Body"> <img src="../../../../Images/cliptype.png" width="175" height="200" alt=""><br> <img src="../../../../Images/intersection.png" width="175" height="200" alt="">&nbsp; <img src="../../../../Images/union.png" width="175" height="200" alt="">&nbsp; <img src="../../../../Images/difference.png" width="175" height="200" alt="">&nbsp; <img src="../../../../Images/xor.png" width="175" height="200" alt=""><br><br> All polygon clipping is performed with a <a href="../Classes/Clipper/_Body.htm">Clipper</a> object with the specific boolean operation indicated by the <em>ClipType</em> parameter passed in its <a href="../Classes/Clipper/Methods/Execute.htm">Execute</a> method. </p><br>
<p class="Body"> With regard to <b>open</b> paths (polylines), clipping rules generally match those of closed paths (polygons).<br> However, when there are both polyline and polygon subjects, the following clipping rules apply:
<ul>
<li>union operations - polylines will be clipped by any overlapping polygons so that non-overlapped portions will be returned in the solution together with the union-ed polygons</li>
<li>intersection, difference and xor operations - polylines will be clipped only by 'clip' polygons and there will be not interaction between polylines and subject polygons.</li>
</ul> </p><br>
<p class="Body"> Example of clipping behaviour when mixing polyline and polygon subjects:<br> <img src="../../../../Images/line_clipping2.png"> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../Overview/_Body.htm">Overview</a>, <a href="../Classes/Clipper/_Body.htm">Clipper</a>, <a href="../Classes/Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="PolyFillType.htm">PolyFillType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,88 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>EndType</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>EndType</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TEndType = (etClosedPolygon, etClosedLine, etOpenSquare, etOpenRound, etOpenButt);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>enum</b> EndType {etClosedPolygon, etClosedLine, etOpenSquare, etOpenRound, etOpenButt};</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public enum</b> EndType {etClosedPolygon, etClosedLine, etOpenSquare, etOpenRound, etOpenButt};</p>
<br>
<p class="Body"> The EndType enumerator has 5 values:
<ul>
<li><b>etClosedPolygon:</b> Ends are joined using the JoinType value and the path filled as a polygon</li>
<li><b>etClosedLine:</b> Ends are joined using the JoinType value and the path filled as a polyline</li>
<li><b>etOpenSquare:</b> Ends are <em>squared</em> off and extended <b>delta</b> units</li>
<li><b>etOpenRound:</b> Ends are <em>rounded</em> off and extended <b>delta</b> units</li>
<li><b>etOpenButt:</b> Ends are squared off with no extension.</li>
<li class="gray"><b>etOpenSingle:</b> Offsets an open path in a single direction. Planned for a future update.</li>
</ul> </p>
<p class="Body"> Note: With <em>etClosedPolygon</em> and <em>etClosedLine</em> types, the path closure will be the same regardless of whether or not the first and last vertices in the path match.<br><br> <img src="../../../../Images/endtypes1.png" alt="" border="0"><br> <img src="../../../../Images/endtypes2.png" alt="" border="0"><br> <br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/ClipperOffset/Methods/AddPath.htm">ClipperOffset.AddPath</a>, <a href="../Classes/ClipperOffset/Methods/AddPaths.htm">ClipperOffset.AddPaths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,75 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>InitOptions</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>InitOptions</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TInitOption = (ioReverseSolution, ioStrictlySimple, ioPreserveCollinear);</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>enum </b> InitOptions {<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ioReverseSolution &nbsp;= 1,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ioStrictlySimple &nbsp;&nbsp;= 2,<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ioPreserveCollinear = 4};</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> public const int ioReverseSolution &nbsp;= 1;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public const int ioStrictlySimple &nbsp;&nbsp;= 2;<br> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; public const int ioPreserveCollinear = 4;</p>
<br>
<p class="Body"> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/Clipper/Methods/Constructor.htm">Clipper.Constructor</a>, <a href="../Classes/Clipper/Properties/PreserveCollinear.htm">Clipper.PreserveCollinear</a>, <a href="../Classes/Clipper/Properties/ReverseSolution.htm">Clipper.ReverseSolution</a>, <a href="../Classes/Clipper/Properties/StrictlySimple.htm">Clipper.StrictlySimple</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,73 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>IntPoint</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>IntPoint</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> TIntPoint = <b>record</b> X, Y: <a href="./CInt.htm">cInt</a>; <b>end;</b></p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>struct</b> IntPoint { <a href="./CInt.htm">cInt</a> X; <a href="./CInt.htm">cInt</a> Y; <b>...</b> };</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public class</b> IntPoint { <b>public</b> <a href="./CInt.htm">cInt</a> X; { get; set; } <b>public</b> <a href="./CInt.htm">cInt</a> Y; { get; set; } <b>...</b> };</p>
<br>
<p class="Body"> The <b>IntPoint</b> structure is used to represent all vertices in the Clipper Library. An <em>integer</em> storage type has been deliberately chosen to preserve <a href="http://www.mpi-inf.mpg.de/~kettner/pub/nonrobust_cgta_06.pdf" target="_blank"><b>numerical robustness</b></a>. (Early versions of the library used floating point coordinates, but it became apparent that floating point imprecision would always cause occasional errors.)<br><br> A sequence of IntPoints are contained within a <a href="./Path.htm">Path</a> structure to represent a single contour.<br><br> As of version 6, IntPoint now has <span class="maroon">an optional third member 'Z'</span>. This can be enabled by exposing (ie uncommenting) the PreProcessor define '<a href="../PreProcessor/Defines.htm"><b>use_xyz</b></a>'. When the Z member is used, its values will be copied to corresponding verticies in solutions to clipping operations. However, at points of intersection where there's no corresponding Z value, the value will be assigned zero unless a new value is provided by a user supplied <a href="../Classes/Clipper/Properties/ZFillFunction.htm"><b>callback function</b></a>.<br><br> Users wishing to clip or offset polygons containing <em>floating point</em> coordinates need to use appropriate scaling when converting these values to and from <em>IntPoints</em>.<br><br> See also the notes on <a href="../../../Overview/Rounding.htm">rounding</a>. </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../Overview/Rounding.htm">Rounding</a>, <a href="../Classes/Clipper/Properties/ZFillFunction.htm">Clipper.ZFillFunction</a>, <a href="../PreProcessor/Defines.htm">Defines</a>, <a href="CInt.htm">CInt</a>, <a href="Path.htm">Path</a>, <a href="Paths.htm">Paths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,69 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>IntRect</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>IntRect</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span><br> TIntRect = <b>record</b> left, top, right, bottom: <a href="./CInt.htm">cInt</a>; <b>end;</b></p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span><br> <b>struct</b> IntRect { <a href="./CInt.htm">cInt</a> left; <a href="./CInt.htm">cInt</a> top; <a href="./CInt.htm">cInt</a> right; <a href="./CInt.htm">cInt</a> bottom; <b>...</b> };</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span><br> <b>public class</b> IntRect {<br> &nbsp;&nbsp;<b>public</b> <a href="./CInt.htm">cInt</a> left; { get; set; }<br> &nbsp;&nbsp;<b>public</b> <a href="./CInt.htm">cInt</a> top; { get; set; }<br> &nbsp;&nbsp;<b>public</b> <a href="./CInt.htm">cInt</a> right; { get; set; }<br> &nbsp;&nbsp;<b>public</b> <a href="./CInt.htm">cInt</a> bottom; { get; set; } <b>...</b> };</p>
<p class="Body">Structure returned by Clipper's <a href="../Classes\ClipperBase\Methods\GetBounds.htm">GetBounds</a> method.</p><br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/ClipperBase/Methods/GetBounds.htm">ClipperBase.GetBounds</a>, <a href="CInt.htm">CInt</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,78 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>JoinType</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>JoinType</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TJoinType = (jtSquare, jtRound, jtMiter);</p>
<p class="Decl2"><span class="Comment"> C++&nbsp;&raquo;</span> <b>enum</b> JoinType {jtSquare, jtRound, jtMiter};</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public enum</b> JoinType {jtSquare, jtRound, jtMiter};</p>
<br>
<p class="Body"> When adding paths to a <a href="../Classes/ClipperOffset/_Body.htm">ClipperOffset</a> object via the <a href="../Classes/ClipperOffset/Methods/AddPaths.htm">AddPaths</a> method, the joinType parameter may be one of three types - jtMiter, jtSquare or jtRound.<br><br> <img src="../../../../Images/jointypes.png" alt="" border="0"><br><br>
<ul>
<li>jtMiter: There's a necessary limit to mitered joins since offsetting edges that join at very acute angles will produce excessively long and narrow 'spikes'. To contain these potential spikes, the ClippOffset object's <a href="../Classes/ClipperOffset/Properties/MiterLimit.htm"><b>MiterLimit</b></a> property specifies a maximum distance that vertices will be offset <em>(in multiples of delta)</em>. For any given edge join, when miter offsetting would exceed that maximum distance, 'square' joining is applied.<br></li>
<li>jtRound: While flattened paths can never perfectly trace an arc, they are approximated by a series of arc chords (see ClipperObject's <a href="../Classes/ClipperOffset/Properties/ArcTolerance.htm"><b>ArcTolerance</b></a> property).<br></li>
<li>jtSquare: Squaring is applied uniformally at all convex edge joins at 1 &times; delta.</li>
</ul> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/ClipperOffset/_Body.htm">ClipperOffset</a>, <a href="../Classes/ClipperOffset/Methods/AddPaths.htm">ClipperOffset.AddPaths</a>, <a href="../Classes/ClipperOffset/Properties/ArcTolerance.htm">ClipperOffset.ArcTolerance</a>, <a href="../Classes/ClipperOffset/Properties/MiterLimit.htm">ClipperOffset.MiterLimit</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,69 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Path</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Path</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> TPath = <b>array of</b> TIntPoint;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>typedef</b> std::vector&lt;IntPoint&gt; Path;</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>using</b> Path = List&lt;IntPoint&gt;;</p>
<br>
<p class="Body"> This structure contains a sequence of <a href="./IntPoint.htm">IntPoint</a> vertices defining <span class="maroon">a single contour</span> (see also <a href="../../../Overview/_Body.htm#terminology">terminology</a>). Paths may be <em>open</em> and represent a series of line segments bounded by 2 or more vertices, or they may be <em>closed</em> and represent polygons. Whether or not a path is open depends on context. <em>Closed</em> paths may be '<em>outer</em>' contours or '<em>hole</em>' contours. Which they are depends on orientation.<br><br> Multiple paths can be grouped into a <a href="./Paths.htm">Paths</a> structure.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../../../Overview/_Body.htm">Overview</a>, <a href="../../../Overview/Example.htm">Example</a>, <a href="../Classes/ClipperBase/Methods/AddPath.htm">ClipperBase.AddPath</a>, <a href="../Classes/PolyTree/_Body.htm">PolyTree</a>, <a href="../Functions/Orientation.htm">Orientation</a>, <a href="IntPoint.htm">IntPoint</a>, <a href="Paths.htm">Paths</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,76 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Paths</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>Paths</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> TPaths = <b>array of </b><a href="./Path.htm">TPath</a>;</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>typedef</b> std::vector&lt; <a href="./Path.htm">Path</a> &gt; Paths;</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>using</b> Paths = List&lt;List&lt; <a href="./IntPoint.htm">IntPoint</a> &gt;&gt;;</p>
<br>
<p class="Body"> This structure is fundamental to the Clipper Library. It's a list or array of one or more <a href="./Path.htm">Path</a> structures. (The <em>Path</em> structure contains an ordered list of vertices that make a single contour.)<br><br> Paths may <em>open</em> (a series of line segments), or they may <em>closed</em> (polygons). Whether or not a path is <em>open</em> depends on context. <em>Closed</em> paths may be '<em>outer</em>' contours or '<em>hole</em>' contours. Which they are depends on orientation.<br><br> </p>
<br>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="../Classes/ClipperBase/Methods/AddPath.htm">ClipperBase.AddPath</a>, <a href="../Classes/ClipperBase/Methods/AddPaths.htm">ClipperBase.AddPaths</a>, <a href="../Functions/OffsetPaths.htm">OffsetPaths</a>, <a href="IntPoint.htm">IntPoint</a>, <a href="Path.htm">Path</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,83 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>PolyFillType</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyFillType</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TPolyFillType = (pftEvenOdd, pftNonZero, pftPositive, pftNegative);</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>enum</b> PolyFillType {pftEvenOdd, pftNonZero, pftPositive, pftNegative};</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public enum</b> PolyFillType {pftEvenOdd, pftNonZero, pftPositive, pftNegative};</p>
<br>
<p class="Body"> <em>Filling</em> indicates those regions that are <em>inside</em> a closed path (ie 'filled' with a brush color or pattern in a graphical display) and those regions that are <em>outside</em>. The Clipper Library supports 4 filling rules: Even-Odd, Non-Zero, Positive and Negative.<br><br> The simplest filling rule is <em>Even-Odd</em> filling (sometimes called <em>alternate</em> filling). Given a group of closed paths start from a point outside the paths and progress along an imaginary line through the paths. When the first path is crossed the encountered region is filled. When the next path is crossed the encountered region is <em>not</em> filled. Likewise, each time a path is crossed, filling starts if it had stopped and stops if it had started.<br><br> With the exception of <em>Even-Odd</em> filling, all other filling rules rely on <b>edge direction</b> and <b>winding numbers</b> to determine filling. Edge direction is determined by the order in which vertices are declared when constructing a path. Edge direction is used to determine the <b>winding number</b> of each polygon subregion.<br><br> <img src="../../../../Images/wn.png" alt="" width="16" height="16" border="0" align="absmiddle"> The winding number for each polygon sub-region can be derived by: <ol>
<li>starting with a winding number of zero and</li>
<li>from a point (P1) that's outside all polygons, draw an imaginary line to a point that's inside a given sub-region (P2)</li>
<li>while traversing the line from P1 to P2, for each path that crosses the imaginary line from right to left increment the winding number, and for each path that crosses the line from left to right decrement the winding number.</li>
<li>Once you arrive at the given sub-region you have its winding number.</li>
</ol> </p>
<p class="Body"> <img src="../../../../Images/winding_number.png" alt="" width="720" height="250" border="0"><br> <b>Even-Odd (Alternate)</b>: Odd numbered sub-regions are filled, while even numbered sub-regions are not.<br> <b>Non-Zero (Winding)</b>: All non-zero sub-regions are filled.<br> <b>Positive</b>: All sub-regions with winding counts &gt; 0 are filled.<br> <b>Negative</b>: All sub-regions with winding counts &lt; 0 are filled.<br><br> Paths are added to a Clipper object using the <a href="../Classes/ClipperBase/Methods/AddPath.htm">AddPath</a> or <a href="../Classes/ClipperBase/Methods/AddPaths.htm">AddPaths</a> methods and the filling rules (for subject and clip polygons separately) are specified in the <a href="../Classes/Clipper/Methods/Execute.htm">Execute</a> method.<br><br> Polygon regions are defined by one or more closed paths which may or may not intersect. A single polygon region can be defined by a single non-intersecting path or by multiple non-intersecting paths where there's typically an 'outer' path and one or more inner 'hole' paths. Looking at the three shapes in the image above, the middle shape consists of two concentric rectangles sharing the same clockwise orientation. With even-odd filling, where orientation can be disregarded, the inner rectangle would create a hole in the outer rectangular polygon. There would be no hole with non-zero filling. In the concentric rectangles on the right, where the inner rectangle is orientated opposite to the outer, a hole will be rendered with either even-odd or non-zero filling. A single path can also define multiple subregions if it self-intersects as in the example of the 5 pointed star shape below.<br><br> <img src="../../../../Images/evenodd.png" alt="" width="175" height="200" border="0">&nbsp;&nbsp; <img src="../../../../Images/nonzero.png" alt="" width="175" height="200" border="0">&nbsp;&nbsp; <img src="../../../../Images/positive.png" alt="" width="175" height="200" border="0">&nbsp;&nbsp; <img src="../../../../Images/negative.png" alt="" width="175" height="200" border="0"><br><br> By far the most widely used fill rules are Even-Odd (aka Alternate) and Non-Zero (aka Winding). Most graphics rendering libraries (<a href="http://www.antigrain.com/__code/include/agg_basics.h.html#filling_rule_e">AGG</a>, <a href="http://developer.android.com/reference/android/graphics/Path.FillType.html">Android Graphics</a>, <a href="http://cairographics.org/manual/cairo-cairo-t.html#cairo-fill-rule-t">Cairo</a>, <a href="http://msdn.microsoft.com/en-us/library/windows/desktop/ms534120(v=vs.85).aspx">GDI+</a>, <a href="http://www.glprogramming.com/red/chapter11.html">OpenGL</a>, <a href="http://developer.apple.com/library/ios/#documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/dq_paths/dq_paths.html#//apple_ref/doc/uid/TP30001066-CH211-TPXREF101">Quartz 2D</a> etc) and vector graphics storage formats (<a href="http://www.w3.org/TR/SVG/painting.html#FillRuleProperty">SVG</a>, Postscript, <a href="http://www.adobe.com/devnet-apps/photoshop/fileformatashtml/PhotoshopFileFormats.htm#50577409_17587">Photoshop</a> etc) support both these rules. However some libraries (eg Java's <a href="http://docs.oracle.com/javase/6/docs/api/java/awt/Graphics.html#fillPolygon(int[], int[], int)">Graphics2D</a>) only support one fill rule. <em>Android Graphics</em> and <em>OpenGL</em> are the only libraries (that I'm aware of) that support multiple filling rules.<br><br> It's useful to note that <em>edge direction</em> has no affect on a winding number's odd-ness or even-ness. (This is why <span class="maroon"><a href="../Functions/Orientation.htm">orientation</a> is ignored when the <em>Even-Odd</em> rule is employed.)</span><br><br> The direction of the Y-axis does affect polygon orientation and <em>edge direction</em>. However, changing Y-axis orientation will only change the <em>sign</em> of winding numbers, not their magnitudes, and has no effect on either <em>Even-Odd</em> or <em>Non-Zero</em> filling.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/Clipper/Methods/Execute.htm">Clipper.Execute</a>, <a href="../Classes/ClipperBase/Methods/AddPath.htm">ClipperBase.AddPath</a>, <a href="../Classes/ClipperBase/Methods/AddPaths.htm">ClipperBase.AddPaths</a>, <a href="../Functions/Orientation.htm">Orientation</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,73 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>PolyType</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>PolyType</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TPolyType = (ptSubject, ptClip);</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>enum</b> PolyType { ptSubject, ptClip };</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public enum</b> PolyType { ptSubject, ptClip };</p>
<br>
<p class="Body"> Boolean (clipping) operations are mostly applied to two sets of Polygons, represented in this library as <em>subject</em> and <em>clip</em> polygons. Whenever Polygons are added to the Clipper object, they must be assigned to either subject or clip polygons.<br><br> UNION operations can be performed on one set or both sets of polygons, but all other boolean operations require both sets of polygons to derive meaningful solutions.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/ClipperBase/Methods/AddPath.htm">ClipperBase.AddPath</a>, <a href="../Classes/ClipperBase/Methods/AddPaths.htm">ClipperBase.AddPaths</a>, <a href="ClipType.htm">ClipType</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,71 @@
<html>
<head>
<script type="text/javascript" src="../../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ZFillCallback</title>
<link rel="stylesheet" href="../../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../../_Body.htm" class="Banner"><img src="../../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" nowrap=""><a href="../_Body.htm" class="Banner"><img src="../../../../Images/_Unit.gif" align="absmiddle">ClipperLib</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ZFillCallback</h1>
<p class="Decl"><span class="Comment">Del.&raquo;</span> <b>type</b> TZFillCallback = <b>procedure</b> (<b>const</b> E1Bot, E1Top, E2Bot, E2Top: TIntPoint; <b>var</b> Pt: TIntPoint);</p>
<p class="Decl2"><span class="Comment">C++&nbsp;&raquo;</span> <b>typedef void</b> (*ZFillCallback)(const IntPoint&amp; e1bot, IntPoint&amp; e1top, IntPoint&amp; e2bot, IntPoint&amp; e2top, IntPoint&amp; pt);</p>
<p class="Decl3"><span class="Comment">C#&nbsp;&nbsp;&raquo;</span> <b>public delegate void</b> ZFillCallback(IntPoint bot1, IntPoint top1, IntPoint bot2, IntPoint top2, ref IntPoint pt);</p>
<br>
<p class="Body"> If the <a href="../PreProcessor/Defines.htm"><b>use_xyz</b></a> pre-processor directive is enabled, then the IntPoint class will have an extra 'Z' member and the Clipper class's <a href="../Classes/Clipper/Properties/ZFillFunction.htm">ZFillFunction</a> property will be exposed so it can be assigned a custom callback function.<br><br> This custom callback procedure requires five IntPoint parameters: the first 2 parameters are the vertices that define one line segment involved in the intersection and the next two parameters the other line segment. <em>(Since the Clipper library has been developed in an environment that uses an inverted Y axis display, e1bot and e2bot will always have Y values greater than or equal to their corresponding e1top and e2top Y values.)</em> The last IntPoint parameter contain the actual coordinates at the intersection. This last parameter is passed by reference so that its Z member can be assigned with a custom value.<br><br> </p>
<h2 id="Auto-SeeAlso">See Also</h2>
<p class="Body"><a href="../Classes/Clipper/Properties/ZFillFunction.htm">Clipper.ZFillFunction</a>, <a href="../PreProcessor/Defines.htm">Defines</a></p>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,188 @@
<html>
<head>
<script type="text/javascript" src="../../../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../../../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../../../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../../../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../../../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../../../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../../../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>ClipperLib</title>
<link rel="stylesheet" href="../../../Styles/default.css" type="text/css">
<script type="text/javascript" src="../../../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<table class="Banner" cellspacing="0" cellpadding="0" border="1" bordercolorlight="#303080" bordercolordark="#7070B0">
<tr>
<td class="Banner" nowrap=""><a href="../../_Body.htm" class="Banner"><img src="../../../Images/_Home.gif" align="absmiddle">Home</a>
</td>
<td class="Banner" width="100%" align="right"><img src="../../../Images/_Project_Logo.gif" align="absmiddle">
</td>
</tr>
</table>
<h1>ClipperLib</h1>
<p class="Body"> Filenames: clipper.pas; clipper.hpp and clipper.cpp; clipper.cs<br><br> Namespace: <b>ClipperLib</b> </p>
<h2 id="Auto-Contents">Contents</h2>
<table>
<tr><th>Types
</th><th>Classes
</th><th>Functions
</th>
</tr>
<tr>
<td><a href="Types/CInt.htm">CInt</a>
</td>
<td><a href="Classes/Clipper/_Body.htm">Clipper</a>
</td>
<td><a href="Functions/Area.htm">Area</a>
</td>
</tr>
<tr>
<td><a href="Types/ClipType.htm">ClipType</a>
</td>
<td><a href="Classes/ClipperBase/_Body.htm">ClipperBase</a>
</td>
<td><a href="Functions/CleanPolygon.htm">CleanPolygon</a>
</td>
</tr>
<tr>
<td><a href="Types/EndType.htm">EndType</a>
</td>
<td><a href="Classes/ClipperOffset/_Body.htm">ClipperOffset</a>
</td>
<td><a href="Functions/CleanPolygons.htm">CleanPolygons</a>
</td>
</tr>
<tr>
<td><a href="Types/InitOptions.htm">InitOptions</a>
</td>
<td><a href="Classes/PolyNode/_Body.htm">PolyNode</a>
</td>
<td><a href="Functions/ClosedPathsFromPolyTree.htm">ClosedPathsFromPolyTree</a>
</td>
</tr>
<tr>
<td><a href="Types/IntPoint.htm">IntPoint</a>
</td>
<td><a href="Classes/PolyTree/_Body.htm">PolyTree</a>
</td>
<td><a href="Functions/MinkowskiDiff.htm">MinkowskiDiff</a>
</td>
</tr>
<tr>
<td><a href="Types/IntRect.htm">IntRect</a>
</td>
<td>
</td>
<td><a href="Functions/MinkowskiSum.htm">MinkowskiSum</a>
</td>
</tr>
<tr>
<td><a href="Types/JoinType.htm">JoinType</a>
</td>
<td>
</td>
<td><a href="Functions/OffsetPaths.htm">OffsetPaths</a>
</td>
</tr>
<tr>
<td><a href="Types/Path.htm">Path</a>
</td>
<td>
</td>
<td><a href="Functions/OpenPathsFromPolyTree.htm">OpenPathsFromPolyTree</a>
</td>
</tr>
<tr>
<td><a href="Types/Paths.htm">Paths</a>
</td>
<td>
</td>
<td><a href="Functions/Orientation.htm">Orientation</a>
</td>
</tr>
<tr>
<td><a href="Types/PolyFillType.htm">PolyFillType</a>
</td>
<td>
</td>
<td><a href="Functions/PointInPolygon.htm">PointInPolygon</a>
</td>
</tr>
<tr>
<td><a href="Types/PolyType.htm">PolyType</a>
</td>
<td>
</td>
<td><a href="Functions/PolyTreeToPaths.htm">PolyTreeToPaths</a>
</td>
</tr>
<tr>
<td><a href="Types/ZFillCallback.htm">ZFillCallback</a>
</td>
<td>
</td>
<td><a href="Functions/ReversePath.htm">ReversePath</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Functions/ReversePaths.htm">ReversePaths</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Functions/SimplifyPolygon.htm">SimplifyPolygon</a>
</td>
</tr>
<tr>
<td>
</td>
<td>
</td>
<td><a href="Functions/SimplifyPolygons.htm">SimplifyPolygons</a>
</td>
</tr>
</table>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Wyświetl plik

@ -0,0 +1,168 @@
<html>
<head>
<script type="text/javascript" src="../Scripts/jquery.js">
</script>
<script type="text/javascript" src="../Scripts/SyntaxHighlighter/scripts/shCore.js">
</script>
<script type="text/javascript" src="../Scripts/SyntaxHighlighter/scripts/shBrushDelphi.js">
</script>
<script type="text/javascript" src="../Scripts/SyntaxHighlighter/scripts/shBrushCpp.js">
</script>
<script type="text/javascript" src="../Scripts/SyntaxHighlighter/scripts/shBrushCSharp.js">
</script>
<link type="text/css" rel="stylesheet" href="../Scripts/SyntaxHighlighter/styles/shCoreDefault.css">
<link type="text/css" rel="stylesheet" href="../Scripts/SyntaxHighlighter/styles/shThemeDefault.css">
<title>Graphics32 Help</title>
<link rel="stylesheet" href="../Styles/default.css" type="text/css">
<meta name="Order" content="Overview, Units">
<script type="text/javascript" src="../Scripts/bootstrap.js">
</script>
</head>
<body bgcolor="#FFFFFF">
<!-- THIS FILE HAS BEEN AUTOMATICALLY PROCESSED FROM A SOURCE COPY -->
<!-- DO NOT EDIT MANUALLY !!! -->
<script language="JavaScript1.2" src="../Scripts/menu_data.js">
</script>
<script language="JavaScript1.2" src="../Scripts/menu_script.js">
</script>
<h1>The Clipper Library - Version 6</h1>
<table>
<tr>
<td><a href="Overview/_Body.htm">Library Overview</a>
</td>
<td><a href="Overview/Changes.htm">Changes</a>
</td>
<td><a href="Overview/Example.htm">Example</a>
</td>
<td><a href="Overview/FAQ.htm">FAQ</a>
</td>
<td><a href="Overview/Rounding.htm">Rounding</a>
</td>
<td><a href="Overview/Deprecated.htm">Deprecated</a>
</td>
<td><a href="Overview/License.htm">License</a>
</td>
</tr>
</table>
<table class="Home" cellpadding="0" cellspacing="0" border="0">
<tr>
<td class="Home" valign="Top">
</td>
<td class="Home" valign="Top">
<h2>Classes (Hierarchy)</h2>
<p Class="Tree"><img src="../Images/_BranchEmpty.gif" align="absmiddle" width="1" height="18"><a href="Units/ClipperLib/Classes/ClipperBase/_Body.htm"><img src="../Images/_Class.gif" align="absmiddle">&nbsp;ClipperBase</a></p>
<p Class="Tree"><img src="../Images/_BranchEmpty.gif" align="absmiddle" width="1" height="18"><img src="../Images/_BranchRight.gif" align="absmiddle"><a href="Units/ClipperLib/Classes/Clipper/_Body.htm"><img src="../Images/_Class.gif" align="absmiddle">&nbsp;Clipper</a></p>
<p Class="Tree"><img src="../Images/_BranchEmpty.gif" align="absmiddle" width="1" height="18"><a href="Units/ClipperLib/Classes/ClipperOffset/_Body.htm"><img src="../Images/_Class.gif" align="absmiddle">&nbsp;ClipperOffset</a></p>
<p Class="Tree"><img src="../Images/_BranchEmpty.gif" align="absmiddle" width="1" height="18"><a href="Units/ClipperLib/Classes/PolyNode/_Body.htm"><img src="../Images/_Class.gif" align="absmiddle">&nbsp;PolyNode</a></p>
<p Class="Tree"><img src="../Images/_BranchEmpty.gif" align="absmiddle" width="1" height="18"><img src="../Images/_BranchRight.gif" align="absmiddle"><a href="Units/ClipperLib/Classes/PolyTree/_Body.htm"><img src="../Images/_Class.gif" align="absmiddle">&nbsp;PolyTree</a></p>
</td>
</tr>
</table>
<h2 id="Auto-Types">Types</h2>
<table>
<tr>
<td><a href="Units/ClipperLib/Types/CInt.htm">CInt</a>
</td>
<td><a href="Units/ClipperLib/Types/InitOptions.htm">InitOptions</a>
</td>
<td><a href="Units/ClipperLib/Types/JoinType.htm">JoinType</a>
</td>
<td><a href="Units/ClipperLib/Types/PolyFillType.htm">PolyFillType</a>
</td>
</tr>
<tr>
<td><a href="Units/ClipperLib/Types/ClipType.htm">ClipType</a>
</td>
<td><a href="Units/ClipperLib/Types/IntPoint.htm">IntPoint</a>
</td>
<td><a href="Units/ClipperLib/Types/Path.htm">Path</a>
</td>
<td><a href="Units/ClipperLib/Types/PolyType.htm">PolyType</a>
</td>
</tr>
<tr>
<td><a href="Units/ClipperLib/Types/EndType.htm">EndType</a>
</td>
<td><a href="Units/ClipperLib/Types/IntRect.htm">IntRect</a>
</td>
<td><a href="Units/ClipperLib/Types/Paths.htm">Paths</a>
</td>
<td><a href="Units/ClipperLib/Types/ZFillCallback.htm">ZFillCallback</a>
</td>
</tr>
</table>
<h2 id="Auto-Functions">Functions</h2>
<table>
<tr>
<td><a href="Units/ClipperLib/Functions/Area.htm">Area</a>
</td>
<td><a href="Units/ClipperLib/Functions/ClosedPathsFromPolyTree.htm">ClosedPathsFromPolyTree</a>
</td>
<td><a href="Units/ClipperLib/Functions/OffsetPaths.htm">OffsetPaths</a>
</td>
<td><a href="Units/ClipperLib/Functions/PointInPolygon.htm">PointInPolygon</a>
</td>
<td><a href="Units/ClipperLib/Functions/ReversePaths.htm">ReversePaths</a>
</td>
</tr>
<tr>
<td><a href="Units/ClipperLib/Functions/CleanPolygon.htm">CleanPolygon</a>
</td>
<td><a href="Units/ClipperLib/Functions/MinkowskiDiff.htm">MinkowskiDiff</a>
</td>
<td><a href="Units/ClipperLib/Functions/OpenPathsFromPolyTree.htm">OpenPathsFromPolyTree</a>
</td>
<td><a href="Units/ClipperLib/Functions/PolyTreeToPaths.htm">PolyTreeToPaths</a>
</td>
<td><a href="Units/ClipperLib/Functions/SimplifyPolygon.htm">SimplifyPolygon</a>
</td>
</tr>
<tr>
<td><a href="Units/ClipperLib/Functions/CleanPolygons.htm">CleanPolygons</a>
</td>
<td><a href="Units/ClipperLib/Functions/MinkowskiSum.htm">MinkowskiSum</a>
</td>
<td><a href="Units/ClipperLib/Functions/Orientation.htm">Orientation</a>
</td>
<td><a href="Units/ClipperLib/Functions/ReversePath.htm">ReversePath</a>
</td>
<td><a href="Units/ClipperLib/Functions/SimplifyPolygons.htm">SimplifyPolygons</a>
</td>
</tr>
</table>
<h2 id="Auto-Units">Units</h2>
<table>
<tr>
<td><a href="Units/ClipperLib/_Body.htm">ClipperLib</a>
</td>
</tr>
</table>
<p class="Copyright" id="auto"> <br><br> Copyright &copy;2010-2014 Angus Johnson&nbsp; - &nbsp; Clipper 6.2.1 &nbsp; - &nbsp; Help file built on 1-November-2014 <br><br> </p>
</body>
</html>

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 56 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 62 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 64 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 65 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 118 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 125 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.6 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 171 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 311 B

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 1.3 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 2.2 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 10 KiB

Some files were not shown because too many files have changed in this diff Show More