all tools
toolsrhino plugin0.1.0

pocketknife: small commands for everyday rhino work

A free Rhino 8 plugin with ten commands and eight Grasshopper components: clean Make2D drawings, clip and rebuild curves, trace footprints, find inner points and minimum boxes, tidy layers.

centroidinner pointalways inside the outlineminimum rectangledashed: the bounding boxxorient to rectangleturned 28° to x
three commands on plan outlines, computed with the plugin's own library.

the problem

Some small tasks come back in every Rhino model. A Make2D drawing full of doubled and broken lines. The outline of a masterplan for a laser-cut base. Curves imported from Revit or SketchUp as hundreds of tiny segments. A label point inside an irregular room. The smallest box around a tilted part.

Rhino has no single command for any of them. Each one takes a few manual steps or a script written again for the occasion.

by hand
a few steps each time
  • Delete duplicates and join Make2D lines one by one
  • Trace the outline of every block for the laser
  • Guess a point inside, check it is not in a courtyard
  • Rotate a part until its box looks smallest
with pocketknife
one command
  • Every line drawn once, joined along the straightest path
  • One closed curve per block, courtyards as holes
  • The point is always inside, holes respected
  • The box is the minimum one, oriented in 3D

what it does

curves
drawings ready for print and laser
pkCleanCurves+ grasshopper
Cleans messy networks such as Make2D output: overlaps and duplicates are drawn once, pieces join along the straightest continuation.
pkClipCurves+ grasshopper
A clipping mask for curves: keeps the pieces inside or outside closed curves and hatches.
pkRebuildCurves+ grasshopper
Turns faceted curves from Revit, SketchUp or Blender into lines, true arcs and light NURBS, keeping the real corners.
pkFootprint+ grasshopper
The exact outline of many buildings on a plane: one closed curve per block, courtyards as holes.
points and boxes
measure and place
pkInnerPoint+ grasshopper
A point always inside closed curves, surfaces, solids and meshes, even for U and C shapes.
pkMinBoundingBox+ grasshopper
The smallest oriented box around objects, with a fast, normal and precise mode.
pkMinBoundingRect+ grasshopper
The smallest rectangle on the XY plane, by area or by perimeter.
pkOrientToMinRect+ grasshopper
Turns objects so their long side follows X or Y, by the smallest angle.
layers
housekeeping
pkCopyToLayerCopy
Copies or moves objects into a copy of their layer tree, at the level you choose.
pkLayerColorFromMaterial
Sets each layer colour from the colour of its render material.

The Grasshopper components are in their own tab, Pocket Knife. pkInfo opens the docs and prints the installed version.

open source
Every command is a readable Python script, released under the MIT licence. Study it, change it, use it in commercial work.

get it

pocketknife is free and published on the Rhino package manager. In Rhino 8, run _PackageManager, search for pocketknife, install it and restart Rhino.