1
1
"""
2
2
coordinates(geometry)
3
3
4
- Returns the positions/coordinates of a geometry.
4
+ Returns the positions/coordinates of a geometry.
5
5
6
- This is allowed to return lazy iterators. Use `decompose(ConcretePointType, geometry)`
6
+ This is allowed to return lazy iterators. Use `decompose(ConcretePointType, geometry)`
7
7
to get a `Vector{ConcretePointType}` with `ConcretePointType` being something like
8
8
`Point3f`.
9
9
"""
14
14
"""
15
15
faces(geometry)
16
16
17
- Returns the faces of a geometry.
17
+ Returns the faces of a geometry.
18
18
19
- This is allowed to return lazy iterators. Use `decompose(ConcreteFaceType, geometry)`
19
+ This is allowed to return lazy iterators. Use `decompose(ConcreteFaceType, geometry)`
20
20
to get a `Vector{ConcreteFaceType}` with `ConcreteFaceType` being something like `GLTriangleFace`.
21
21
"""
22
22
function faces (f:: AbstractVector{<:AbstractFace} )
26
26
"""
27
27
normals(primitive)
28
28
29
- Returns the normals of a geometry.
29
+ Returns the normals of a geometry.
30
30
31
- This is allowed to return lazy iterators. Use `decompose_normals(ConcreteVecType, geometry)`
31
+ This is allowed to return lazy iterators. Use `decompose_normals(ConcreteVecType, geometry)`
32
32
to get a `Vector{ConcreteVecType}` with `ConcreteVecType` being something like `Vec3f`.
33
33
"""
34
34
function normals (primitive, nvertices= nothing ; kw... )
49
49
"""
50
50
texturecoordinates(primitive)
51
51
52
- Returns the texturecoordinates of a geometry.
52
+ Returns the texturecoordinates of a geometry.
53
53
54
- This is allowed to return lazy iterators. Use `decompose_uv(ConcreteVecType, geometry)`
55
- (or `decompose_uvw`) to get a `Vector{ConcreteVecType}` with `ConcreteVecType` being
54
+ This is allowed to return lazy iterators. Use `decompose_uv(ConcreteVecType, geometry)`
55
+ (or `decompose_uvw`) to get a `Vector{ConcreteVecType}` with `ConcreteVecType` being
56
56
something like `Vec2f`.
57
57
"""
58
58
texturecoordinates (primitive, nvertices= nothing ) = nothing
@@ -61,9 +61,9 @@ texturecoordinates(primitive, nvertices=nothing) = nothing
61
61
Tessellation(primitive, nvertices)
62
62
63
63
When generating a mesh from an abstract geometry, we can typically generate it
64
- at different levels of detail, i.e. with different amounts of vertices. The
64
+ at different levels of detail, i.e. with different amounts of vertices. The
65
65
`Tessellation` wrapper allows you to specify this level of detail. When generating
66
- a mesh from a tessellated geometry, the added information will be passed to
66
+ a mesh from a tessellated geometry, the added information will be passed to
67
67
`coordinates`, `faces`, etc.
68
68
69
69
```julia
@@ -127,7 +127,7 @@ Normal() = Normal(Vec3f)
127
127
decompose(::Type{TargetType}, primitive)
128
128
decompose(::Type{TargetType}, data::AbstractVector)
129
129
130
- Dependent on the given type, extracts data from the primtive and converts its
130
+ Dependent on the given type, extracts data from the primtive and converts its
131
131
eltype to `TargetType`.
132
132
133
133
Possible `TargetType`s:
@@ -149,22 +149,22 @@ function decompose(::Type{F}, primitive::AbstractGeometry) where {F<:AbstractFac
149
149
end
150
150
return decompose (F, f)
151
151
end
152
-
152
+
153
153
function decompose (:: Type{F} , f:: AbstractVector ) where {F<: AbstractFace }
154
154
fs = faces (f)
155
155
isnothing (fs) && error (" No faces defined for $(typeof (f)) " )
156
156
return collect_with_eltype (F, fs)
157
157
end
158
158
159
159
# TODO : Should this be a completely different function?
160
- function decompose (:: Type{F} , f:: AbstractVector , views:: Vector{UnitRange{Int }} ) where {F<: AbstractFace }
160
+ function decompose (:: Type{F} , f:: AbstractVector , views:: Vector{UnitRange{IT }} ) where {F<: AbstractFace , IT <: Integer }
161
161
fs = faces (f)
162
162
isnothing (fs) && error (" No faces defined for $(typeof (f)) " )
163
163
if isempty (views)
164
164
return collect_with_eltype (F, fs), views
165
165
else
166
166
output = F[]
167
- new_views = sizehint! (UnitRange{Int }[], length (views))
167
+ new_views = sizehint! (UnitRange{IT }[], length (views))
168
168
for range in views
169
169
start = length (output) + 1
170
170
collect_with_eltype! (output, view (fs, range))
0 commit comments