Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix typos #235

Merged
merged 1 commit into from
Feb 3, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/src/primitives.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ end
```

To connect these points into a mesh, we need to generate a set of faces.
The faces of a prallelepiped are parallelograms, which we can describe with `QuadFace`.
Here we should be concious of the winding direction of faces.
The faces of a parallelepiped are parallelograms, which we can describe with `QuadFace`.
Here we should be conscious of the winding direction of faces.
They are often used to determine the front vs the backside of a (2D) face.
For example GeometryBasics normal generation and OpenGL's backface culling assume a counter-clockwise windig direction to correspond to a front-facing face.
For example GeometryBasics normal generation and OpenGL's backface culling assume a counter-clockwise winding direction to correspond to a front-facing face.
This means that if we look at a face from outside the shape, the positions referred to by that face should be ordered counter-clockwise.
With that in mind the faces of our primitive become:

Expand Down
2 changes: 1 addition & 1 deletion src/basic_types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ texturecoordinates(mesh::Mesh) = hasproperty(mesh, :uv) ? mesh.uv : nothing
"""
vertex_attributes(mesh::Mesh)

Returns a dictionairy containing the vertex attributes of the given mesh.
Returns a dictionary containing the vertex attributes of the given mesh.
Mutating these will change the mesh.
"""
vertex_attributes(mesh::Mesh) = getfield(mesh, :vertex_attributes)
Expand Down
2 changes: 1 addition & 1 deletion src/boundingboxes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ end
"""
Rect(points::AbstractArray{<: Point})

Construct a bounding box countaining all the given points.
Construct a bounding box containing all the given points.
"""
function Rect{N1,T1}(geometry::AbstractArray{PT}) where {N1,T1,PT<:Point}
N2, T2 = length(PT), eltype(PT)
Expand Down
4 changes: 2 additions & 2 deletions src/interfaces.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function normals(primitive, nvertices=nothing; kw...)
# doesn't have any specific algorithm to generate normals
# so will be generated from faces + positions
# which we indicate by returning nothing!
# Overload normals(primitive::YourPrimitive), to calcalute the normals
# Overload normals(primitive::YourPrimitive), to calculate the normals
# differently
return nothing
end
Expand Down Expand Up @@ -127,7 +127,7 @@ Normal() = Normal(Vec3f)
decompose(::Type{TargetType}, primitive)
decompose(::Type{TargetType}, data::AbstractVector)

Dependent on the given type, extracts data from the primtive and converts its
Dependent on the given type, extracts data from the primitive and converts its
eltype to `TargetType`.

Possible `TargetType`s:
Expand Down
12 changes: 6 additions & 6 deletions src/meshes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ facetype(::Mesh{D, T, FT}) where {D, T, FT} = FT
uv_mesh(primitive::GeometryPrimitive{N}[; pointtype = Point{N, Float32}, facetype = GLTriangleFace, uvtype = Vec2f])

Creates a triangle mesh with texture coordinates from a given `primitive`. The
`pointtype`, `facetype` and `uvtype` are set by the correspondering keyword arguments.
`pointtype`, `facetype` and `uvtype` are set by the corresponding keyword arguments.

See also: [`triangle_mesh`](@ref), [`normal_mesh`](@ref), [`uv_mesh`](@ref), [`uv_normal_mesh`](@ref)
"""
Expand All @@ -154,7 +154,7 @@ end

Creates a triangle mesh with texture coordinates and normals from a given
`primitive`. The `pointtype`, `facetype` and `uvtype` and `normaltype` are set
by the correspondering keyword arguments.
by the corresponding keyword arguments.

See also: [`triangle_mesh`](@ref), [`normal_mesh`](@ref), [`uv_mesh`](@ref), [`uv_normal_mesh`](@ref)
"""
Expand All @@ -175,7 +175,7 @@ end

Creates a triangle mesh with texture coordinates and normals from a given
`primitive`. The `pointtype`, `facetype` and `uvtype` and `normaltype` are set
by the correspondering keyword arguments.
by the corresponding keyword arguments.

See also: [`triangle_mesh`](@ref), [`normal_mesh`](@ref), [`uv_mesh`](@ref), [`uv_normal_mesh`](@ref)
"""
Expand All @@ -192,7 +192,7 @@ end
normal_mesh(primitive::GeometryPrimitive{N}[; pointtype = Point{N, Float32}, facetype = GLTriangleFace, normaltype = Vec3f])

Creates a triangle mesh with normals from a given `primitive`. The `pointtype`, `facetype` and `uvtype` and `normaltype` are set
by the correspondering keyword arguments.
by the corresponding keyword arguments.

See also: [`triangle_mesh`](@ref), [`normal_mesh`](@ref), [`uv_mesh`](@ref), [`uv_normal_mesh`](@ref)
"""
Expand Down Expand Up @@ -333,7 +333,7 @@ end
expand_faceviews(mesh::Mesh)

Returns the given `mesh` if it contains no FaceViews. Otherwise, generates a new
mesh that contains no FaceViews, reordering and duplicating vertex atttributes
mesh that contains no FaceViews, reordering and duplicating vertex attributes
as necessary. If the mesh has `views` they will be adjusted as needed to produce
the same submeshes.
"""
Expand Down Expand Up @@ -417,7 +417,7 @@ function merge_vertex_indices(
# indices that remap attributes
attribute_indices = ntuple(n -> sizehint!(UInt32[], N_faces), N_Attrib)

# keep track of the remmaped indices for one vertex so we don't have to
# keep track of the remapped indices for one vertex so we don't have to
# query the dict twice
temp = Vector{T}(undef, N)

Expand Down
16 changes: 8 additions & 8 deletions src/primitives/rectangles.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
HyperRectangle{N, T}

A `HyperRectangle` is a generalization of a rectangle into N-dimensions.
Formally it is the cartesian product of intervals, which is represented by the
Formally it is the Cartesian product of intervals, which is represented by the
`origin` and `widths` fields, whose indices correspond to each of the `N` axes.
"""
struct HyperRectangle{N,T} <: GeometryPrimitive{N,T}
Expand All @@ -17,7 +17,7 @@ end
"""
const Rect{N,T} = HyperRectangle{N,T}

A rectangle in N dimensions, formally the cartesian product of intervals. See also [`HyperRectangle`](@ref). Its aliases are
A rectangle in N dimensions, formally the Cartesian product of intervals. See also [`HyperRectangle`](@ref). Its aliases are

| |`T`(eltype)|`Float64` |`Float32` |`Int` |
|--------|-----------|----------|----------|----------|
Expand Down Expand Up @@ -216,12 +216,12 @@ function Base.:(*)(m::Mat{N1,N1,T1}, h::Rect{N2,T2}) where {N1,N2,T1,T2}

# get all points on the Rect
d = decompose(Point, h)
# make sure our points are sized for the tranform
# make sure our points are sized for the transform
pts = (Vec{N1,T}[vcat(pt, ones(Vec{D,T})) for pt in d]...,)::NTuple{2^N2,Vec{N1,T}}

vmin = Vec{N1,T}(typemax(T))
vmax = Vec{N1,T}(typemin(T))
# tranform all points, tracking min and max points
# transform all points, tracking min and max points
for pt in pts
pn = m * pt
vmin = min.(pn, vmin)
Expand All @@ -239,11 +239,11 @@ function Base.:(*)(m::Mat{N,N,T1}, h::Rect{N,T2}) where {N,T1,T2}
# get all points on the Rect
pts = decompose(Point, h)

# make sure our points are sized for the tranform
# make sure our points are sized for the transform
vmin = Vec{N,T}(typemax(T))
vmax = Vec{N,T}(typemin(T))

# tranform all points, tracking min and max points
# transform all points, tracking min and max points
for pt in pts
pn = m * Vec(pt)
vmin = min.(pn, vmin)
Expand All @@ -262,13 +262,13 @@ function Base.:(*)(m::Mat{4,4,T}, h::Rect{3,T}) where {T}
Vec{4,T}(0.0, 0.0, 1.0, 1.0), Vec{4,T}(1.0, 0.0, 1.0, 1.0),
Vec{4,T}(0.0, 1.0, 1.0, 1.0), Vec{4,T}(1.0, 1.0, 1.0, 1.0))

# make sure our points are sized for the tranform
# make sure our points are sized for the transform
vmin = Vec{4,T}(typemax(T))
vmax = Vec{4,T}(typemin(T))
o, w = origin(h), widths(h)
_o = Vec{4,T}(o[1], o[2], o[3], T(0))
_w = Vec{4,T}(w[1], w[2], w[3], T(1))
# tranform all points, tracking min and max points
# transform all points, tracking min and max points
for pt in pts
pn = m * (_o + (pt .* _w))
vmin = min.(pn, vmin)
Expand Down
2 changes: 1 addition & 1 deletion src/triangulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function decompose(::Type{F}, points::AbstractVector{<:Point}) where {F<:Abstrac
t += 1
end
nv -= 1
#= resest error detection counter =#
#= reset error detection counter =#
count = 2 * nv
end
end
Expand Down
2 changes: 1 addition & 1 deletion src/viewtypes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ end
connect(points::AbstractVector{<: Point}, P::Type{<: Polytope{N}}, skip::Int = N)

Creates a view that connects a number of points to a Polytope `P`.
Between each polytope, `skip` elements are skipped untill the next starts.
Between each polytope, `skip` elements are skipped until the next starts.
Example:
```julia
x = connect(Point[(1, 2), (3, 4), (5, 6), (7, 8)], Line, 2)
Expand Down
2 changes: 1 addition & 1 deletion test/meshes.jl
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ end
@test faces(m) == fs
end

@testset "Verifaction" begin
@testset "Verification" begin
# enough vertices present
@test_throws ErrorException Mesh(rand(Point2f, 7), fs)
m = Mesh(rand(Point2f, 12), fs)
Expand Down
Loading