class Celestine::Rough

Overview

Algorithmic hand-drawn sketchy vector generator for Celestine Generates organic, sketchy multi-pass paths with deterministic jitter and bowing.

Defined in:

rough/rough.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(roughness : Float64 = 1.0, bowing : Float64 = 1.0, passes : Int32 = 2, max_random_offset : Float64 = 2.0, seed : UInt64 = 42_u64) #

[View source]

Instance Method Detail

def bowing : Float64 #

[View source]
def bowing=(bowing : Float64) #

[View source]
def circle(path : Celestine::Path, cx : Number, cy : Number, r : Number) : Nil #

Adds a sketchy circle centered at (cx, cy) with radius r to the given path


[View source]
def line(path : Celestine::Path, x1 : Number, y1 : Number, x2 : Number, y2 : Number) : Nil #

Adds a sketchy line between (x1, y1) and (x2, y2) to the given path


[View source]
def max_random_offset : Float64 #

[View source]
def max_random_offset=(max_random_offset : Float64) #

[View source]
def passes : Int32 #

[View source]
def passes=(passes : Int32) #

[View source]
def polygon(path : Celestine::Path, points : Array(Tuple(IFNumber, IFNumber)) | Array(Celestine::Point) | Array(Celestine::FPoint)) : Nil #

Adds a sketchy polygon connecting the points


[View source]
def rect(path : Celestine::Path, x : Number, y : Number, width : Number, height : Number) : Nil #

Adds a sketchy rectangle to the given path


[View source]
def rng : Random::PCG32 #

[View source]
def rng=(rng : Random::PCG32) #

[View source]
def roughness : Float64 #

[View source]
def roughness=(roughness : Float64) #

[View source]