clipper

Grasshopper Clipper

Clipper is a 2D polygon Clipper offering polygon boolean operations (clipping): Intersection, Join, Difference, XOR. Offsets for polygons and Minkowski Sum and Differences.

Related Lessons & Examples

Dendro Waffle
In this grasshopper example file, you can create a waffle structure by using the dendro plugin to ma...
Hexagonal Building
In this Grasshopper example file, you will learn how to model a parametric building using hexagonal...
Lisbon Orient Station
In this Grasshopper example file, you can design a building similar to the Lisbon Orient Station by...
Mesh Maze
Mesh Maze
In this Grasshopper example file, you can Generate a Maze (Based on Backtracking Algorithm) on any G...
Parakeet Chair
In this grasshopper Parakeet example file, you can model a parametric Chair by using the differentia...
Parametric Maze
In this Grasshopper example file you can design a parametric maze and find the path from a starting...
Plan Drafting
Plan Drafting
In this Grasshopper Script, You can add details to your plan by providing lines for the wall, doors,...
Polygon Star
In this Grasshopper fennec example file you can learn how to use the "polygon star" component to des...
Polyline Offset
In this Grasshopper short Tutorial,you can learn how to model a parametric offset surface by using t...
Random Shelves
In this grasshopper example file you can design a series of parametric random shelves.
Structure Plan
In this Grasshopper Example File, You can use the fennec plugin to design a parametric structure pla...
Voronoize
In this Grasshopper Voronoize example file, you can convert Any surface ,polySurface, brep or mesh i...

Clipper Plugin

Clipper is a 2D polygon Clipper offering polygon boolean operations (clipping): Intersection, Join, Difference, XOR. Offsets for polygons and Minkowski Sum and Differences.

Download from this page, from github (no login required), or using the experimental package manager for Rhino 6 (type command: TestPackageManager.

For support installing this plugin, please do not use the comments below, but use the grasshopper and rhino forum at discourse.mcneel.com with the tag clipper.

The good stuff:

  • it accepts all types of polygons including self-intersecting ones
  • it supports multiple polygon filling rules (EvenOdd, NonZero)
  • it’s very fast relative to the RhinoCommon counterparts
  • it also performs line and polygon offsetting
  • it’s numerically robust
  • it’s free to use in both freeware and commercial applications
  • it’s open source
  • it’s native .NET

What is does not do

  • Curved shapes are not supported, and are translated to polylines in the command.
  • Only planar operations are supported

Installation

For windows: Install the clipper-[version].rhi, this will install both the rhino plugin and the grasshopper plugin.

For Mac OSX: Install the clipper-[version].macrhi, this will install both the rhino plugin and the grasshopper plugin

Package manager: Using rhino 6+’s experimental package manager/yak (from version 0.3.0): using the command TestPackageManager

Manual installation: Download the .zip file, and place in rhino’s plugin and grasshopper component folder.

Source code is available on github, available under the open source (permissive) Boost licence, free to use for any purpose.

Usage in Rhino:

The commands OffsetPolyline and BooleanPolyline offer interactive commands for the clipper library. This means multiple sets of curves/polylines will be

Usage in Grasshopper:

Examples can be found on github in the folder examples

Offsets

  • Example 1: Simple single polygon offset (Star offset)
  • Example 2: Multiple polygon offsets (Urban plan)

Boolean operations

  • Example 3: Moire effect

Minkowski Sums

  • Example 4: Slide an object over another

Usage in python

The components are available in the ClipperComponents namespace

import ghpythonlib.components as ghcomp
ghcomp.ClipperComponents.PolylineOffset
ghcomp.ClipperComponents.PolylineBoolean
ghcomp.ClipperComponents.PolylineContainment
ghcomp.ClipperComponents.MinkowskiSum
ghcomp.ClipperComponents.MinkowskiDifference

Example usage of OffsetPolyline

Version

Older versions can be downloaded from the github release page.

2021-10-12: Version 0.3.3: Polyline Boolean component no longer throws an exception when the A input list is empty.
2020-04-20: Version 0.3.2: Added offset type selector and improved compatiblity with RhinoInside and RhinoCompute, thanks to Andrew Heumann
2020-04-01: Version 0.3.1: Released new version that fixes compatiblity with ShapeDiver
2019-10-09: Version 0.3.0: Released new version for yak and macrhi. Improved placement in grasshopper menu’s
2019-07-22: Version 0.2.3: Updated to clipper version 6.4.2
2017-02-15: Version 0.2.2: Update to new clipper version (6 .4.0), release for Rhino WIP
2014-07-06: Version 0.1, first beta release

API’s may change, components may change, and things may stop working in the way they do now in the future.

TODO

  • Api documentation

Credits

Angus Johnson for writing the clipper library.

Andrew Heumann for kindly contributing code improvements

Thanks goes out to the friends at APTO who triggered the requirements for this plugin, and to Maarten Filius for the initial testing.

Contact

Arend van Waart [email protected]