pub trait LineClip {
fn clipwith(
&self,
clipobj: &Self
) -> Result<MultiLineString<f64>, Box<dyn Error>>;
fn maskwith(
&self,
maskobj: &Self
) -> Result<MultiLineString<f64>, Box<dyn Error>>;
}
Expand description
#LineClip
self.clipwith will clip self
with a foreground object clipobj
, returning a MultiLineString
Result. Self can be a:
and clipobj
has to be one of:
If clipobj
is a line which is NOT closed, then it will be automatically converted to
a closed polygon for the purposes of clipping. The original clipobj
is NOT modified.
Regardless of self being lines or polygons, the result is a set of lines suitable for output to a plotter. Returning original source geometry is going to be a separate trait, which I’ll get around to once I need it.
maskwith is the inverse: only objects (or the portions thereof) which intersect with the maskobj will be returned.