summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 07f872b)
raw | patch | inline | side by side (parent: 07f872b)
author | scislac <scislac@users.sourceforge.net> | |
Mon, 5 Oct 2009 20:47:05 +0000 (20:47 +0000) | ||
committer | scislac <scislac@users.sourceforge.net> | |
Mon, 5 Oct 2009 20:47:05 +0000 (20:47 +0000) |
index a730f14ff2c8f9f0f25aa9f82a7da7a028465781..abd975b4ebe61023f2cfcb13d6fe192996b61b8a 100755 (executable)
using namespace Geom;
+ // Don't allow empty path parameters:
+ if ( bend_path1.get_pathvector().empty()
+ || bend_path2.get_pathvector().empty()
+ || bend_path3.get_pathvector().empty()
+ || bend_path4.get_pathvector().empty() )
+ {
+ return pwd2_in;
+ }
+
/*
The code below is inspired from the Bend Path code developed by jfb and mgsloan
Please, read it before tring to understand this one
index e19d2e6e744701bacce89e7116d6610101b7b1b1..e77a392e9f4fe8f377fbe6a887c7b35b2a7fa9cf 100644 (file)
Geom::PathVector
LPEInterpolate::doEffect_path (Geom::PathVector const & path_in)
{
- if ( (path_in.size() < 2) || (number_of_steps < 2))
+ if ( (path_in.size() < 2) || (number_of_steps < 2)) {
return path_in;
+ }
+ // Don't allow empty path parameter:
+ if ( trajectory_path.get_pathvector().empty() ) {
+ return path_in;
+ }
std::vector<Geom::Path> path_out;
index cd724b70e173a6d1c5cb6b8cb7391a1283621bf1..a3a0faf3755b37e8f38d1ae75aef8b70d743003e 100644 (file)
std::vector<Geom::Path>
LPEMirrorSymmetry::doEffect_path (std::vector<Geom::Path> const & path_in)
{
+ // Don't allow empty path parameter:
+ if ( reflection_line.get_pathvector().empty() ) {
+ return path_in;
+ }
+
std::vector<Geom::Path> path_out;
if (!discard_orig_path) {
path_out = path_in;
index 29c5517bfe4485814fc4a2fd7704e648035a2fa4..45b2b67b4505630f1cec7ac4cf49c3d8a9018f0c 100644 (file)
The first step is to re-parametrize B by its arc length: this is the parametrization in which a point p on B is located by its distance s from start. One obtains a new map s --> U(s) = (a'(s),b'(s)), that still describes the same path B, but where the distance along B from start to
U(s) is s itself.
-We also need a unit normal to the path. This can be obtained by computing a unit tangent vector, and rotate it by 90°. Call this normal vector N(s).
+We also need a unit normal to the path. This can be obtained by computing a unit tangent vector, and rotate it by 90�. Call this normal vector N(s).
The basic deformation associated to B is then given by:
@@ -104,6 +104,11 @@ LPEPatternAlongPath::doEffect_pwd2 (Geom::Piecewise<Geom::D2<Geom::SBasis> > con
{
using namespace Geom;
+ // Don't allow empty path parameter:
+ if ( pattern.get_pathvector().empty() ) {
+ return pwd2_in;
+ }
+
/* Much credit should go to jfb and mgsloan of lib2geom development for the code below! */
Piecewise<D2<SBasis> > output;
std::vector<Geom::Piecewise<Geom::D2<Geom::SBasis> > > pre_output;