Skip to content

Commit c2623e8

Browse files
committed
fix grammar and structure in the decomposition page
1 parent f0896b9 commit c2623e8

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

docs/src/decomposition.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,21 @@ To display geometry primitives, they need to be decomposable.
77
This can be done for any arbitrary primitive, by overloading the following interface:
88

99
```julia
10-
# Lets take SimpleRectangle as an example:
11-
# Minimal set of decomposable attributes to build up a triangle mesh
10+
# Let's take SimpleRectangle as an example:
11+
# Below is a minimal set of decomposable attributes to build up a triangle mesh:
1212
isdecomposable(::Type{T}, ::Type{HR}) where {T<:Point, HR<:SimpleRectangle} = true
1313
isdecomposable(::Type{T}, ::Type{HR}) where {T<:Face, HR<:SimpleRectangle} = true
1414

15-
# Example implementation of decompose for points
15+
# This is an example implementation of `decompose` for points.
1616
function GeometryBasics.decompose(P::Type{Point{3, PT}}, r::SimpleRectangle, resolution=(2,2)) where PT
1717
w,h = resolution
18-
vec(P[(x,y,0) for x=range(r.x, stop = r.x+r.w, length = w), y=range(r.y, stop = r.y+r.h, length = h)])
18+
vec(
19+
PT[
20+
(x,y,0)
21+
for x in range(r.x, stop = r.x+r.w, length = w),
22+
y in range(r.y, stop = r.y+ r .h, length = h)
23+
]
24+
)
1925
end
2026

2127
function GeometryBasics.decompose(::Type{T}, r::SimpleRectangle, resolution=(2,2)) where T <: Face
@@ -42,4 +48,4 @@ normals(m) # automatically calculated from mesh
4248
```
4349

4450
As you can see, the normals are automatically calculated only with the faces and points.
45-
You can overwrite that behavior, by also defining decompose for the `Normal` type!
51+
You can overwrite that behavior by also defining decompose for the `Normal` type!

0 commit comments

Comments
 (0)