Inkscape
Vector Graphics Editor
|
Boolean operations. More...
Go to the source code of this file.
Functions | |
static Shape | make_shape (Path &path, int path_id=-1, FillRule fill_rule=fill_nonZero, bool close_if_needed=true) |
Create a flattened shape from a path. | |
static Path | make_path (Geom::PathVector const &pathv, std::vector< Geom::PathVectorTime > const &cuts) |
Create a path with backdata from a pathvector, automatically estimating a suitable conversion threshold. | |
static bool | is_line (Path const &path) |
Return whether a path is a single open line segment. | |
static void | distribute_intersection_times (std::vector< Geom::PathVectorTime > &dst1, std::vector< Geom::PathVectorTime > &dst2, std::vector< Geom::PathVectorIntersection > const &intersections) |
static void | sort_and_clean_intersection_times (std::vector< Geom::PathVectorTime > &vec) |
Geom::PathVector | flattened (Geom::PathVector const &pathv, FillRule fill_rule) |
Flatten a pathvector according to the given fill rule. | |
void | flatten (Geom::PathVector &pathv, FillRule fill_rule) |
std::vector< Geom::PathVector > | pathvector_cut (Geom::PathVector const &pathv, Geom::PathVector const &lines) |
Cut a pathvector along a collection of lines into several smaller pathvectors. | |
Geom::PathVector | sp_pathvector_boolop (Geom::PathVector const &pathva, Geom::PathVector const &pathvb, BooleanOp bop, FillRule fra, FillRule frb) |
Perform a boolean operation on two pathvectors. | |
Variables | |
constexpr auto | RELATIVE_THRESHOLD = 0.08 |
Boolean operations.
Definition in file path-boolop.cpp.
|
inlinestatic |
Definition at line 124 of file path-boolop.cpp.
References Geom::EPSILON.
Referenced by Inkscape::ObjectSet::_pathBoolOp(), flattened(), pathvector_cut(), and sp_pathvector_boolop().
void flatten | ( | Geom::PathVector & | pathv, |
FillRule | fill_rule | ||
) |
Definition at line 172 of file path-boolop.cpp.
References flattened().
Referenced by Inkscape::BooleanBuilder::BooleanBuilder(), Inkscape::SubItem::build_flatten(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPEMirrorSymmetry::doEffect_path(), SPText::getInclusionShape(), item_to_paths(), and Inkscape::LivePathEffect::LPESlice::splititem().
Geom::PathVector flattened | ( | Geom::PathVector const & | pathv, |
FillRule | fill_rule | ||
) |
Flatten a pathvector according to the given fill rule.
Definition at line 157 of file path-boolop.cpp.
References distribute_intersection_times(), Geom::PathVector::intersectSelf(), make_path(), make_shape(), Path::MakePathVector(), and sort_and_clean_intersection_times().
Referenced by flatten(), and Inkscape::SubItem::operator+=().
|
static |
Return whether a path is a single open line segment.
Definition at line 119 of file path-boolop.cpp.
References Path::pts.
|
static |
Create a path with backdata from a pathvector, automatically estimating a suitable conversion threshold.
Definition at line 106 of file path-boolop.cpp.
References Path::LoadPathVector(), RELATIVE_THRESHOLD, and result.
Referenced by flattened(), pathvector_cut(), and sp_pathvector_boolop().
|
static |
Create a flattened shape from a path.
path | The path to convert. |
path_id | The id to assign to all the edges in the resultant shape. |
fill_rule | The fill rule with which to flatten the path. |
close_if_needed | If the path is not closed, whether to add a closing segment. |
Definition at line 89 of file path-boolop.cpp.
References Path::Fill(), and result.
Referenced by flattened(), pathvector_cut(), and sp_pathvector_boolop().
std::vector< Geom::PathVector > pathvector_cut | ( | Geom::PathVector const & | pathv, |
Geom::PathVector const & | lines | ||
) |
Cut a pathvector along a collection of lines into several smaller pathvectors.
Definition at line 181 of file path-boolop.cpp.
References bool_op_cut, Shape::Booleen(), Shape::ConvertToFormeNested(), distribute_intersection_times(), fill_justDont, Geom::PathVector::intersect(), Geom::PathVector::intersectSelf(), is_line(), make_path(), make_shape(), paths, result, sort_and_clean_intersection_times(), and Path::SubPathsWithNesting().
Referenced by Inkscape::SubItem::build_mosaic().
|
static |
Definition at line 138 of file path-boolop.cpp.
References end, and Geom::EPSILON.
Referenced by Inkscape::ObjectSet::_pathBoolOp(), flattened(), pathvector_cut(), and sp_pathvector_boolop().
Geom::PathVector sp_pathvector_boolop | ( | Geom::PathVector const & | pathva, |
Geom::PathVector const & | pathvb, | ||
BooleanOp | bop, | ||
FillRule | fra, | ||
FillRule | frb | ||
) |
Perform a boolean operation on two pathvectors.
Definition at line 222 of file path-boolop.cpp.
References bool_op_cut, bool_op_diff, bool_op_inters, bool_op_slice, bool_op_symdiff, bool_op_union, Shape::Booleen(), Shape::ConvertToForme(), Shape::ConvertToShape(), distribute_intersection_times(), Shape::ebData, fill_justDont, FIRST, Shape::getEdge(), Shape::getPoint(), Shape::hasBackData(), Shape::dg_point::incidentEdge, Geom::PathVector::intersect(), Geom::PathVector::intersectSelf(), is_line(), make_path(), make_shape(), Shape::NextAt(), Shape::numberOfEdges(), Shape::numberOfPoints(), result, sort_and_clean_intersection_times(), Shape::dg_arete::st, Shape::SubEdge(), and Shape::dg_point::totalDegree().
Referenced by Inkscape::UI::Tools::PencilTool::_addFreehandPoint(), Inkscape::Extension::Internal::Emf::add_clips(), Inkscape::Extension::Internal::Wmf::add_clips(), Inkscape::SubItem::build_flatten(), Inkscape::LivePathEffect::LPEBool::divisionit(), Inkscape::do_offset(), Inkscape::LivePathEffect::LPEBool::doEffect(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path(), Inkscape::LivePathEffect::LPECopyRotate::doEffect_path_post(), Inkscape::Extension::Internal::PrintEmf::fill(), Inkscape::Extension::Internal::PrintWmf::fill(), Inkscape::LivePathEffect::LPEBool::fractureit(), Inkscape::LivePathEffect::LPEBool::get_union(), intersect_clips(), Inkscape::Extension::Internal::PrintEmf::merge_PathVector_with_shape(), and Inkscape::SubItem::operator+=().
|
constexpr |
Definition at line 100 of file path-boolop.cpp.
Referenced by Inkscape::ObjectSet::_pathBoolOp(), and make_path().