Skip to content

Commit 02ed799

Browse files
authored
Fix x86 failures (#229)
* add x86 CI * try fix x86 * fix missing type change * exclude x86 macos * fix inferred Int types in tests * bump version [skip ci]
1 parent 2407d53 commit 02ed799

File tree

7 files changed

+90
-84
lines changed

7 files changed

+90
-84
lines changed

.github/workflows/ci.yml

+4
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,10 @@ jobs:
2424
- windows-latest
2525
arch:
2626
- x64
27+
- x86
28+
exclude:
29+
- os: macOS-latest
30+
arch: x86
2731
steps:
2832
- uses: actions/checkout@v2
2933
- uses: julia-actions/setup-julia@v1

Project.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "GeometryBasics"
22
uuid = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
33
authors = ["SimonDanisch <[email protected]>"]
4-
version = "0.5.0"
4+
version = "0.5.1"
55

66
[deps]
77
EarCut_jll = "5ae413db-bbd1-5e63-b57d-d24a61df00f5"

src/basic_types.jl

+5-4
Original file line numberDiff line numberDiff line change
@@ -552,12 +552,12 @@ struct Mesh{
552552

553553
vertex_attributes::NamedTuple{Names, VAT}
554554
faces::FVT
555-
views::Vector{UnitRange{Int}}
555+
views::Vector{UnitRange{UInt32}}
556556

557557
function Mesh(
558558
vertex_attributes::NamedTuple{Names, VAT},
559559
fs::FVT,
560-
views::Vector{UnitRange{Int}} = UnitRange{Int}[]
560+
views::Vector{<: UnitRange{<: Integer}} = UnitRange{UInt32}[]
561561
) where {
562562
FT <: AbstractFace, FVT <: AbstractVector{FT}, Names, Dim, T,
563563
VAT <: Tuple{<: AbstractVector{Point{Dim, T}}, Vararg{VertexAttributeType}}
@@ -669,13 +669,14 @@ and have faces of matching length.
669669
sub-meshes. This is done by providing ranges for indexing faces which correspond
670670
to the sub-meshes. By default this is left empty.
671671
"""
672-
function Mesh(faces::AbstractVector{<:AbstractFace}; views::Vector{UnitRange{Int}} = UnitRange{Int}[], attributes...)
672+
function Mesh(faces::AbstractVector{<:AbstractFace};
673+
views::Vector{<: UnitRange{<: Integer}} = UnitRange{UInt32}[], attributes...)
673674
return Mesh(NamedTuple(attributes), faces, views)
674675
end
675676

676677
function Mesh(points::AbstractVector{Point{Dim, T}},
677678
faces::AbstractVector{<:AbstractFace};
678-
views = UnitRange{Int}[], kwargs...) where {Dim, T}
679+
views = UnitRange{UInt32}[], kwargs...) where {Dim, T}
679680
va = (position = points, kwargs...)
680681
return Mesh(va, faces, views)
681682
end

src/interfaces.jl

+15-15
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
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)`
77
to get a `Vector{ConcretePointType}` with `ConcretePointType` being something like
88
`Point3f`.
99
"""
@@ -14,9 +14,9 @@ end
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)`
2020
to get a `Vector{ConcreteFaceType}` with `ConcreteFaceType` being something like `GLTriangleFace`.
2121
"""
2222
function faces(f::AbstractVector{<:AbstractFace})
@@ -26,9 +26,9 @@ end
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)`
3232
to get a `Vector{ConcreteVecType}` with `ConcreteVecType` being something like `Vec3f`.
3333
"""
3434
function normals(primitive, nvertices=nothing; kw...)
@@ -49,10 +49,10 @@ end
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
5656
something like `Vec2f`.
5757
"""
5858
texturecoordinates(primitive, nvertices=nothing) = nothing
@@ -61,9 +61,9 @@ texturecoordinates(primitive, nvertices=nothing) = nothing
6161
Tessellation(primitive, nvertices)
6262
6363
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
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
131131
eltype to `TargetType`.
132132
133133
Possible `TargetType`s:
@@ -149,22 +149,22 @@ function decompose(::Type{F}, primitive::AbstractGeometry) where {F<:AbstractFac
149149
end
150150
return decompose(F, f)
151151
end
152-
152+
153153
function 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)
157157
end
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

Comments
 (0)