Struct geos::BufferParams

source ·
pub struct BufferParams { /* private fields */ }
Expand description

Contains the parameters which describe how a Geometry buffer should be constructed using buffer_with_params

Implementations§

source§

impl BufferParams

source

pub fn new() -> GResult<BufferParams>

source

pub fn builder() -> BufferParamsBuilder

source

pub fn set_end_cap_style(&mut self, style: CapStyle) -> GResult<()>

Specifies the end cap style of the generated buffer.

source

pub fn set_join_style(&mut self, style: JoinStyle) -> GResult<()>

Sets the join style for outside (reflex) corners between line segments.

source

pub fn set_mitre_limit(&mut self, limit: f64) -> GResult<()>

Sets the limit on the mitre ratio used for very sharp corners.

The mitre ratio is the ratio of the distance from the corner to the end of the mitred offset corner. When two line segments meet at a sharp angle, a miter join will extend far beyond the original geometry. (and in the extreme case will be infinitely far.) To prevent unreasonable geometry, the mitre limit allows controlling the maximum length of the join corner. Corners with a ratio which exceed the limit will be beveled.

source

pub fn set_quadrant_segments(&mut self, quadsegs: i32) -> GResult<()>

Sets the number of line segments used to approximate an angle fillet.

  • If quadsegs >= 1, joins are round, and quadsegs indicates the number of segments to use to approximate a quarter-circle.
  • If quadsegs = 0, joins are bevelled (flat)
  • If quadSegs < 0, joins are mitred, and the value of qs indicates the mitre ration limit as mitreLimit = |quadsegs|

For round joins, quadsegs determines the maximum error in the approximation to the true buffer curve.

The default value of 8 gives less than 2% max error in the buffer distance.

For a max error of < 1%, use QS = 12. For a max error of < 0.1%, use QS = 18. The error is always less than the buffer distance (in other words, the computed buffer curve is always inside the true curve).

source

pub fn set_single_sided(&mut self, is_single_sided: bool) -> GResult<()>

Sets whether the computed buffer should be single-sided.

A single-sided buffer is constructed on only one side of each input line.

The side used is determined by the sign of the buffer distance:

  • a positive distance indicates the left-hand side
  • a negative distance indicates the right-hand side

The single-sided buffer of point geometries is the same as the regular buffer.

The End Cap Style for single-sided buffers is always ignored, and forced to the equivalent of CapStyle::Flat.

Trait Implementations§

source§

impl ContextHandling for BufferParams

source§

impl ContextInteractions for BufferParams

source§

fn set_context_handle(&mut self, context: ContextHandle)

source§

fn get_context_handle(&self) -> &ContextHandle

source§

fn get_last_error(&self) -> Option<String>

Gets the last error (if any) from the ContextHandle held by this object. Read more
source§

fn get_last_notification(&self) -> Option<String>

Gets the last notification (if any) from the ContextHandle held by this object. Read more
source§

impl Drop for BufferParams

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl Send for BufferParams

source§

impl Sync for BufferParams

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.