Compass icon

Added in v0.1.0

A free pencil-style compass icon, drawn by code from 1 circle and 1 closed shape. Use it as an SVG, a React component, or by name. MIT licensed.

compass

01Use it

Use compass

One package, four ways in. The icon inherits currentColor and is decorative unless you give it a title. Install it with npm i @matita/icons.

React

import { Compass } from '@matita/icons/react';

<Compass size={24} />

// or by name
import { SketchIcon } from '@matita/icons/react';
<SketchIcon name="compass" />

JavaScript

import { Compass, toSvg } from '@matita/icons';

toSvg(Compass, { size: 24 });   // SVG string

SVG

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="24" height="24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" overflow="visible" class="sketch-icon sketch-icon-compass" data-sketch="" aria-hidden="true"><path d="M4.87 7.42C5.2 7.09 6.13 6.03 6.86 5.46C7.59 4.88 8.39 4.29 9.26 3.96C10.13 3.63 11.16 3.42 12.09 3.46C13.02 3.5 13.93 3.91 14.84 4.2C15.76 4.49 16.82 4.65 17.57 5.2C18.32 5.75 18.89 6.67 19.34 7.49C19.79 8.32 20.03 9.24 20.26 10.15C20.5 11.06 20.82 12.04 20.73 12.95C20.63 13.86 20.14 14.78 19.71 15.62C19.28 16.46 18.81 17.33 18.15 17.98C17.49 18.62 16.6 19.07 15.76 19.51C14.91 19.95 14.01 20.44 13.08 20.59C12.15 20.74 11.11 20.6 10.18 20.39C9.24 20.18 8.27 19.85 7.48 19.34C6.69 18.84 6.03 18.09 5.41 17.37C4.79 16.65 4.17 15.89 3.77 15.03C3.36 14.17 3.01 13.16 2.97 12.21C2.93 11.25 3.42 9.79 3.51 9.31" stroke-width="1.712"/><path d="M15.32 8.45Q14.26 10.86 13.34 13.33Q10.93 14.21 8.61 15.3Q9.83 13.04 10.72 10.63Q13.05 9.6 15.32 8.45Q15.15 8.97 14.91 9.47" stroke-width="1.456"/></svg>

Pencil variant

import '@matita/icons/pencil.css';
import { Compass } from '@matita/icons/react';

<Compass size={32} pencil />

The file is icons/compass.svg in the package (pencil/compass.svg for the pencil variant). Matita 0.7.0.

02How it's drawn

The recipe for compass

Compass is not stored as a drawing. It is a recipe of 1 circle and 1 closed shape on a 24 by 24 grid, and a small program draws it like a pencil would. The wobble comes from the name, so it always comes out the same.

A · Recipe
C 12 12 8.5;
Z 15.5 8.5 13.3 13.3 8.5 15.5 10.7 10.7
B · Plotted
C · Drawn
How it works

03Takes, sizes, pencil

Same icon, every way

Pass a seed for another take of the same recipe. The wobble is capped, so it still reads at 16 px.

seed 0
seed 1
seed 2
seed 3
seed 4

Five seeds of compass. Seed 0 is the default.

wobble 0
wobble 0.25
wobble 0.5
wobble 0.75
wobble 1

compass from exact shapes (wobble 0) to the full hand (wobble 1, the default). The exact version is also a ready-made file: exact/compass.svg.

16 px
20 px
24 px
32 px
48 px
96 px

True pixel sizes.

Ink
Pencil