From 5334edc963ab7c64e94eec93c363b6e876fe7e04 Mon Sep 17 00:00:00 2001 From: Yuto Horikawa Date: Sun, 10 Dec 2023 19:49:17 +0900 Subject: [PATCH] Remove unnecessary `static` keyword (#110) * 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> --- src/obj.jl | 9 ++------- src/shape.jl | 4 ++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/obj.jl b/src/obj.jl index 223b3173..a37cfcba 100644 --- a/src/obj.jl +++ b/src/obj.jl @@ -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}[] @@ -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 |") diff --git a/src/shape.jl b/src/shape.jl index 82e086b1..26cf1256 100644 --- a/src/shape.jl +++ b/src/shape.jl @@ -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]