generativeart/docs/doc.md

301 lines
5.9 KiB
Markdown
Raw Permalink Normal View History

2021-03-18 05:26:55 +00:00
# Table of Contents
- [Table of Contents](#table-of-contents)
- [Color Circle 2](#color-circle-2)
- [parameters](#parameters)
- [Dot Line](#dot-line)
- [parameters](#parameters-1)
- [Random Shape](#random-shape)
- [parameters](#parameters-2)
- [Janus](#janus)
- [TODO](#todo)
- [parameters](#parameters-3)
- [Contour Line](#contour-line)
- [parameters](#parameters-4)
- [Silk Sky](#silk-sky)
- [parameters](#parameters-5)
- [Julia](#julia)
- [parameters](#parameters-6)
- [Noise Line](#noise-line)
- [parameters](#parameters-7)
- [Ocean Fish](#ocean-fish)
- [parameters](#parameters-8)
- [Circle Loop2](#circle-loop2)
- [parameters](#parameters-9)
- [Pixel Hole](#pixel-hole)
- [parameters](#parameters-10)
- [Dots Wave](#dots-wave)
- [parameters](#parameters-11)
- [Circle Move](#circle-move)
- [parameters](#parameters-12)
- [Circle Noise](#circle-noise)
- [parameters](#parameters-13)
- [Yarn](#yarn)
- [parameters](#parameters-14)
2021-03-19 06:23:42 +00:00
- [Black Hole](#black-hole)
- [parameters](#parameters-15)
2021-03-22 06:58:39 +00:00
- [Color Canva](#color-canva)
- [parameters](#parameters-16)
2021-03-30 02:49:33 +00:00
- [Domain Warping](#domain-warping)
- [parameters](#parameters-17)
2021-04-07 09:22:53 +00:00
- [Perlin Perls](#perlin-perls)
- [parameters](#parameters-18)
2021-03-22 06:58:39 +00:00
2021-03-08 07:56:32 +00:00
## Color Circle 2
2021-03-09 06:43:22 +00:00
`Color Circle2` is version 2 of `Color Circle`. It still draws the circle and point cloud.
2021-03-08 07:56:32 +00:00
### parameters
2021-03-09 06:43:22 +00:00
- circleNum: The number of the circle in this drawing.
2021-03-08 07:56:32 +00:00
```go
2021-03-18 05:26:55 +00:00
cc := arts.NewColorCircle2(30)
2021-03-08 07:56:32 +00:00
```
![](../images/colorcircle2.png)
## Dot Line
2021-03-09 06:43:22 +00:00
`dot line` would draw images with the short dot and short. The short lines would compose as a big circle.
2021-03-08 07:56:32 +00:00
### parameters
2021-03-09 06:43:22 +00:00
- n: The number of elements in this image.
2021-03-08 07:56:32 +00:00
- ras/canv: Control the appearance of this image.
2021-03-09 06:43:22 +00:00
- randColor: Use the specified color or random colors.
2021-03-08 07:56:32 +00:00
```go
2021-03-18 05:26:55 +00:00
dl := arts.NewDotLine(100, 20, 50, false)
2021-03-08 07:56:32 +00:00
```
![](../images/dotline.png)
## Random Shape
`random shape` would draw images with random shapes. The whole image would rotate with some degree.
### parameters
- shapeNum: It indicates how many shapes you want to draw.
```go
rs := NewRandomShape(150)
```
![](../images/randomshape.png)
## Janus
2021-03-09 06:08:33 +00:00
`Janus` would draw an image with multiple circles split at its center with random noise in the horizontal direction.
2021-03-08 07:56:32 +00:00
### TODO
### parameters
2021-03-09 06:08:33 +00:00
## Contour Line
2021-03-09 06:43:22 +00:00
`Contour Line` uses the `perlin noise` to do some flow field.
2021-03-09 06:08:33 +00:00
### parameters
- lineNum: It indicates how many lines.
![](../images/contourline.png)
2021-03-22 06:58:39 +00:00
2021-03-08 07:56:32 +00:00
## Silk Sky
2021-03-22 06:58:39 +00:00
`Silk Sky` would draw an image with multiple circles converge to one point or one circle.
2021-03-08 07:56:32 +00:00
### parameters
- circleNum: The number of the circles in this drawing.
- sunRadius: The radius of the sun. The sun is a point/circle where other circles meet.
```go
silkSky := NewSilkSky(circleNum int, sunRadius float64)
```
![](../images/silksky.png)
## Julia
`Julia` is to draw a `Julia Set`. [Julia Set](https://en.wikipedia.org/wiki/Julia_set) is a math concept. You can define your own formula in this package.
### parameters
- fn: The custom julia set function.
- maxz: The maximum modulus length of a complex number.
2021-03-09 06:08:33 +00:00
- xaixs, yaixs: The range for the X-Y coordination used to mapping the julia set number to the real pixel of the image. These should be positive. It only indicates the first quadrant range.
2021-03-08 07:56:32 +00:00
```go
func julia1(z complex128) complex128 {
2021-03-22 06:58:39 +00:00
c := complex(-0.1, 0.651)
z = z*z + c
return z
2021-03-08 07:56:32 +00:00
}
2021-03-18 05:26:55 +00:00
julia := arts.NewJulia(julia1, 40, 1.5, 1.5)
2021-03-08 07:56:32 +00:00
```
2021-03-09 11:07:47 +00:00
![](../images/julia.png)
## Noise Line
`Noise Line` draws some random line and circles based on `perlin noise`.
### parameters
- n: The number of random line.
```go
2021-03-18 05:26:55 +00:00
nl := arts.NewNoiseLine(1000)
2021-03-09 11:07:47 +00:00
```
2021-03-10 03:58:56 +00:00
![](../images/noiseline.png)
## Ocean Fish
`Ocean Fish` draws an ocean and some fishes in the center.
2021-03-10 03:58:56 +00:00
### parameters
- lineNum: The number of the line used to simulate the ocean wave.
- fishNum: The number of fish.
```go
2021-03-18 05:26:55 +00:00
o := arts.NewOceanFish(100, 8)
2021-03-10 03:58:56 +00:00
```
![](../images/oceanfish.png)
## Circle Loop2
`Circle loop2` draws a circle composed by colored circles.
### parameters
- depth: Control the number of circles.
```go
2021-03-18 05:26:55 +00:00
cl := arts.NewCircleLoop2(7)
```
![](../images/colorloop2.png)
## Pixel Hole
`Pixel Hole` draws a hole with colored dots.
### parameters
- dotN: The number of point in each iteration.
```go
2021-03-18 05:26:55 +00:00
ph := arts.NewPixelHole(60)
```
2021-03-12 07:18:07 +00:00
![](../images/pixelhole.png)
## Dots Wave
### parameters
- dotsN: The number of dots wave in the image.
```go
2021-03-18 05:26:55 +00:00
d := arts.NewDotsWave(300)
2021-03-12 07:18:07 +00:00
```
2021-03-16 03:33:09 +00:00
![](../images/dotswave.png)
## Circle Move
### parameters
- circleNum: The number of the circle in the image.
```go
2021-03-18 05:26:55 +00:00
cm := arts.NewCircleMove(1000)
2021-03-16 03:33:09 +00:00
```
2021-03-17 08:29:20 +00:00
![](../images/circlemove.png)
2021-03-18 05:26:55 +00:00
## Circle Noise
2021-03-17 08:29:20 +00:00
### parameters
- dotsN: The number of dot.
- colorMin: The minimum color.
- colorMax: The maximum color.
2021-03-18 05:26:55 +00:00
![](../images/circlenoise.png)
## Yarn
### parameters
2021-03-19 06:23:42 +00:00
- n: The number of the curve.
2021-03-18 05:26:55 +00:00
```go
y := arts.NewYarn(2000)
```
2021-03-19 06:23:42 +00:00
![](../images/yarn.png)
## Black Hole
### parameters
- circleN: The number of the circle.
- density: Control the density of the circle.
- circleGap: Identify the gap between two circles.
```go
b := arts.NewBlackHole(200, 400, 0.01)
```
2021-03-22 06:58:39 +00:00
![](../images/blackhole.png)
## Color Canva
### parameters
- seg:
```go
cc := arts.NewColorCanve(5)
```
![](../images/colorcanva.png)
2021-03-30 02:49:33 +00:00
## Domain Warping
Warping, or domain distortion is a very common technique in computer graphics for generating procedural textures and geometry. It's often used to pinch an object, stretch it, twist it, bend it, make it thicker or apply any deformation you want.
### parameters
- scale: Control the noise generator.
- xOffset: Control the noise generator.
- yOffset: Control the noise generator.
- fn: A function to mapping the `noise` to color.
```go
d := arts.NewDomainWrap(0.01, 4, 8, cmap)
```
2021-04-07 09:22:53 +00:00
![](../images/domainwarp.png)
## Perlin Perls
### parameters
- circleN: The number of circle on this image.
- dotsN: The number of dots in each circle.
- colorMin: The minimum color.
- colorMax: The maximum color.
```go
pp := arts.NewPerlinPerls(10, 200, 40, 80
```
![](../images/perlinperls.png)