Skip to content

Commit

Permalink
Remove unnecessary static keyword (#110)
Browse files Browse the repository at this point in the history
* remove unnecessary `static` keyword

* Apply suggestions from code review

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>

---------

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
  • Loading branch information
hyrodium and github-actions[bot] authored Dec 10, 2023
1 parent 5e11263 commit 5334edc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions src/obj.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ end
"""
loadobj(shapepath::String; scale=1, message=true) -> nodes, faces
"""
function loadobj(shapepath::String; scale=1, static=true, message=true)
function loadobj(shapepath::String; scale = 1, message = true)

nodes = SVector{3,Float64}[]
faces = SVector{3,Int64}[]
Expand All @@ -30,12 +30,7 @@ function loadobj(shapepath::String; scale=1, static=true, message=true)
end

nodes *= scale # if scale is 1000, converted [km] to [m]

if static == true
nodes = [SVector{3,Float64}(node) for node in nodes]
faces = [SVector{3,Int64}(face) for face in faces]
end


if message == true
println("+-----------------------------+")
println("| Load OBJ file |")
Expand Down
4 changes: 2 additions & 2 deletions src/shape.jl
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@ function Base.show(io::IO, shape::ShapeModel)
print(io, msg)
end

function load_shape_obj(shapepath; scale=1.0, find_visible_facets=false)
function load_shape_obj(shapepath; scale = 1.0, find_visible_facets = false)
# TODO: use MeshIO.jl
nodes, faces = loadobj(shapepath; scale=scale, static=true, message=false)
nodes, faces = loadobj(shapepath; scale = scale, message = false)

face_centers = [face_center(nodes[face]) for face in faces]
face_normals = [face_normal(nodes[face]) for face in faces]
Expand Down

0 comments on commit 5334edc

Please sign in to comment.