Skip to content

Commit 33afb92

Browse files
committed
use string instead of code for shapefile
1 parent 6014393 commit 33afb92

File tree

3 files changed

+7
-9
lines changed

3 files changed

+7
-9
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ LightXML = "0.9"
4141
LinearAlgebra = "1.6"
4242
MeshIO = "0.4, 0.5"
4343
MetaGraphsNext = "0.7"
44-
ModelingToolkit = "11.4"
44+
ModelingToolkit = "11.5.1"
4545
ModelingToolkitStandardLibrary = "2.26"
4646
OrdinaryDiffEqNonlinearSolve = "1.14.1"
4747
OrdinaryDiffEqRosenbrock = "1.17.0"

ext/Render.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -241,17 +241,17 @@ end
241241
242242
function get_shapefile(sys, sol)::String
243243
try
244-
sf = sol(sol.t[1], idxs=collect(sys.shapefile))
245-
decode(sf)
244+
sf = sol(sol.t[1], idxs=sys.shapefile)
245+
# decode(sf)
246246
catch
247247
""
248248
end
249249
end
250250
251251
function get_shape(sys, sol)::String
252252
try
253-
sf = sol(sol.t[1], idxs=collect(sys.shape))
254-
decode(sf)
253+
sf = sol(sol.t[1], idxs=sys.shape)
254+
# decode(sf)
255255
catch
256256
""
257257
end

src/components.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,6 @@ See also [`BodyCylinder`](@ref) and [`BodyBox`](@ref) for body components with p
526526
)
527527
528528
529-
shapecode = encode(shapefile)
530-
shape = encode(shape)
531529
pars = @parameters begin
532530
m = m, [description = "mass"]
533531
I_11=I_11, [description = "Element (1,1) of inertia tensor"]
@@ -542,12 +540,12 @@ See also [`BodyCylinder`](@ref) and [`BodyBox`](@ref) for body components with p
542540
]
543541
radius = radius, [description = "Radius of the body in animations"]
544542
color[1:4] = color, [description = "Color of the body in animations"]
545-
shapefile[1:length(shapecode)] = shapecode
543+
shapefile::String = shapefile
546544
shape_transform[1:16] = vec(shape_transform)
547545
shape_scale = shape_scale
548546
width = width, [description = """Width of the body in animations (if shape = "box")"""]
549547
height = height, [description = """Height of the body in animations (if shape = "box")"""]
550-
shape[1:length(shape)] = shape
548+
shape::String = shape
551549
end
552550
systems = @named begin
553551
translation = FixedTranslation(r = r, render=false)

0 commit comments

Comments
 (0)