Skip to content

Commit 4bcc2ed

Browse files
committed
enhanced readme
1 parent 49c23ab commit 4bcc2ed

3 files changed

Lines changed: 50 additions & 2 deletions

File tree

README.md

Lines changed: 50 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,52 @@
11
# Patch2PDF Rasterizer
22

3-
This rasterizer is used for 2D renderings of stage models. </br>
4-
It is heavily inspired by [this course](https://haqr.eu/tinyrenderer/)
3+
This rasterizer is used for 2D renderings of stage models.
4+
5+
Triangle Rasterization is inspired by [this course](https://haqr.eu/tinyrenderer/) and has been enhanced with custom performance optimisations.
6+
7+
In addition to only drawing the stage model, labels with the corresponding fixture id can also be added.
8+
9+
## Configuration
10+
11+
Each Canvas output can be customized via the `RasterizerConfig` struct.
12+
See below for examples
13+
14+
## Examples
15+
16+
### Without Labels
17+
18+
```go
19+
RasterizerConfig{
20+
RenderLabels: false,
21+
Rotation: rasterizer.Rotation{Alpha: 80, Beta: 0, Gamma: 200},
22+
OverrideColors: OverrideColorMap{},
23+
CanvasConfig: CanvasConfig{
24+
Width: 4000,
25+
Height: 3000,
26+
LabelFont: fontBytes, // raw bytes of an embedded ttf font
27+
LabelDPI: 300,
28+
LabelFontSize: 10,
29+
}
30+
}
31+
```
32+
33+
![Rendering without Labels](images/side.png)
34+
35+
### With Labels
36+
37+
```go
38+
RasterizerConfig{
39+
RenderLabels: true,
40+
Rotation: rasterizer.Rotation{Alpha: 90, Beta: 0, Gamma: 180},
41+
OverrideColors: OverrideColorMap{},
42+
CanvasConfig: CanvasConfig{
43+
Width: 4000,
44+
Height: 3000,
45+
LabelFont: fontBytes, // raw bytes of an embedded ttf font
46+
LabelDPI: 300,
47+
LabelFontSize: 10,
48+
}
49+
}
50+
```
51+
52+
![Rendering with Labels](images/front.png)

images/front.png

155 KB
Loading

images/side.png

104 KB
Loading

0 commit comments

Comments
 (0)