motif: Design Tile Pattern

Description Usage Arguments Examples

View source: R/motif.R

Description

Design Tile Pattern

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
motif(
  box = rbind(c(-1, 0), c(1, 0), c(1, 2), c(-1, 2), c(-1, 0)),
  midpoint = c(0, 0),
  theta = 30,
  delta = 0.2,
  n = 4,
  dist = 0.001,
  circle = FALSE,
  radius = NULL,
  polyLine = F,
  drawBox = FALSE,
  cropBox = NULL
)

Arguments

box

the polygon that the shape constructed by it.

midpoint

is one point in boundary box that basis lines are constructed.

theta

the angle of basis lines in degree between 0 to 90.

delta

the distance of basis lines between 0 to 1 (it depend on boundary box).

n

the number of sides of polygon.

dist

is the size of interior lines.

circle

is a Boolean variable that makes regions based on the intersection of circles instead of lines.

radius

the double variable that if is not null, sets the line length or radius of the circle.

drawBox

to show boundary box set it TRUE.

cropBox

the polygon that the motif is cropped by it.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
library(ggplot2)
tile <- motif(theta = 45, delta = 0.5, polyLine = T)
tilePlotter(tile)
tile <- motif(theta = 45, delta = 0.5, dist = 0.05, polyLine = F)
tilePlotter(tile)
s3 = sqrt(3)
hexagonal = rbind(c(-1,0), c(1,0), c(2,s3), c(1,2*s3), c(-1,2*s3),c(-2,s3),c(-1,0))
tile <- motif(theta = 45, n = 6, delta = 0.2, midpoint = c(0,0),
                box = hexagonal, drawBox = T, polyLine = T)
tilePlotter(tile)

Ehyaei/Kaashi documentation built on Dec. 17, 2021, 6:23 p.m.