11"""
22 coordinates(geometry)
33
4- Returns the positions/coordinates of a geometry.
4+ Returns the positions/coordinates of a geometry.
55
6- This is allowed to return lazy iterators. Use `decompose(ConcretePointType, geometry)`
6+ This is allowed to return lazy iterators. Use `decompose(ConcretePointType, geometry)`
77to get a `Vector{ConcretePointType}` with `ConcretePointType` being something like
88`Point3f`.
99"""
1414"""
1515 faces(geometry)
1616
17- Returns the faces of a geometry.
17+ Returns the faces of a geometry.
1818
19- This is allowed to return lazy iterators. Use `decompose(ConcreteFaceType, geometry)`
19+ This is allowed to return lazy iterators. Use `decompose(ConcreteFaceType, geometry)`
2020to get a `Vector{ConcreteFaceType}` with `ConcreteFaceType` being something like `GLTriangleFace`.
2121"""
2222function faces (f:: AbstractVector{<:AbstractFace} )
2626"""
2727 normals(primitive)
2828
29- Returns the normals of a geometry.
29+ Returns the normals of a geometry.
3030
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)`
3232to get a `Vector{ConcreteVecType}` with `ConcreteVecType` being something like `Vec3f`.
3333"""
3434function normals (primitive, nvertices= nothing ; kw... )
4949"""
5050 texturecoordinates(primitive)
5151
52- Returns the texturecoordinates of a geometry.
52+ Returns the texturecoordinates of a geometry.
5353
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
5656something like `Vec2f`.
5757"""
5858texturecoordinates (primitive, nvertices= nothing ) = nothing
@@ -61,9 +61,9 @@ texturecoordinates(primitive, nvertices=nothing) = nothing
6161 Tessellation(primitive, nvertices)
6262
6363When 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
6565`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
6767`coordinates`, `faces`, etc.
6868
6969```julia
@@ -127,7 +127,7 @@ Normal() = Normal(Vec3f)
127127 decompose(::Type{TargetType}, primitive)
128128 decompose(::Type{TargetType}, data::AbstractVector)
129129
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
131131eltype to `TargetType`.
132132
133133Possible `TargetType`s:
@@ -149,22 +149,22 @@ function decompose(::Type{F}, primitive::AbstractGeometry) where {F<:AbstractFac
149149 end
150150 return decompose (F, f)
151151end
152-
152+
153153function decompose (:: Type{F} , f:: AbstractVector ) where {F<: AbstractFace }
154154 fs = faces (f)
155155 isnothing (fs) && error (" No faces defined for $(typeof (f)) " )
156156 return collect_with_eltype (F, fs)
157157end
158158
159159# 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 }
161161 fs = faces (f)
162162 isnothing (fs) && error (" No faces defined for $(typeof (f)) " )
163163 if isempty (views)
164164 return collect_with_eltype (F, fs), views
165165 else
166166 output = F[]
167- new_views = sizehint! (UnitRange{Int }[], length (views))
167+ new_views = sizehint! (UnitRange{IT }[], length (views))
168168 for range in views
169169 start = length (output) + 1
170170 collect_with_eltype! (output, view (fs, range))
0 commit comments