Skip to content

Commit c14e61c

Browse files
Merge pull request #34 from ModiaSim/an_visualizeAABBinThreejs
An visualize aab bin threejs
2 parents 05192b7 + 4d13e57 commit c14e61c

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

src/Composition/object3D.jl

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ function createConvexPartition(obj::Object3D, feature, mesh) # feature Visual
403403
# names = Vector{AbstractString}()
404404
i = 1
405405
for name in contentDir
406-
path = String(Symbol(obj.path, ".", "mesh[", i , "]"))
406+
path = String(Symbol(obj.path, ".", "mesh", i ,))
407407
(head,ext) = splitext(name)
408408
if ext == ".obj"
409409
fileMesh = Modia3D.FileMesh(filename = joinpath(convexDecompositionDirectory, name),
@@ -432,7 +432,7 @@ function addAABBVisuToWorld!(world::Object3D, AABB::Vector{Vector{Basics.Boundin
432432
@inbounds for i = 1:length(AABB)
433433
for j = 1:length(AABB[i])
434434
k = k + 1
435-
name = String(Symbol(world.path, ".", "AABBVisu", "[", i, "][",j,"]"))
435+
name = String(Symbol(world.path, ".", "AABBVisu", i, j))
436436
aabb = AABB[i][j]
437437
feature = Modia3D.Visual(shape = Modia3D.Box(
438438
lengthX = abs(aabb.x_max - aabb.x_min), lengthY = abs(aabb.y_max - aabb.y_min), lengthZ = abs(aabb.z_max - aabb.z_min)),
@@ -447,8 +447,8 @@ function addContactVisuObjToWorld!(world::Object3D, nVisualContSupPoints, defaul
447447
world.contactVisuObj1 = fill(Object3D(), nVisualContSupPoints)
448448
world.contactVisuObj2 = fill(Object3D(), nVisualContSupPoints)
449449
@inbounds for i = 1:length(world.contactVisuObj1)
450-
name1 = String(Symbol(world.path, ".", "contactVisuObj1", "[", i, "]"))
451-
name2 = String(Symbol(world.path, ".", "contactVisuObj2", "[", i, "]"))
450+
name1 = String(Symbol(world.path, ".", "contactVisuObj1", i))
451+
name2 = String(Symbol(world.path, ".", "contactVisuObj2", i))
452452

453453
feature1 = Modia3D.Visual(shape = Modia3D.Sphere(diameter = defaultContactSphereDiameter), visualMaterial = Modia3D.VisualMaterial(color="Red", transparency=1.0))
454454
feature2 = Modia3D.Visual(shape = Modia3D.Sphere(diameter = defaultContactSphereDiameter), visualMaterial = Modia3D.VisualMaterial(color="Black", transparency=1.0))
@@ -466,12 +466,12 @@ function addSupportVisuObjToWorld!(world::Object3D, nVisualContSupPoints, defaul
466466
world.supportVisuObj2B = fill(Object3D(), nVisualContSupPoints)
467467
world.supportVisuObj3B = fill(Object3D(), nVisualContSupPoints)
468468
@inbounds for i = 1:length(world.supportVisuObj1A)
469-
name1 = String(Symbol(world.path, ".", "supportVisuObj1A", "[", i, "]"))
470-
name2 = String(Symbol(world.path, ".", "supportVisuObj2A", "[", i, "]"))
471-
name3 = String(Symbol(world.path, ".", "supportVisuObj3A", "[", i, "]"))
472-
name4 = String(Symbol(world.path, ".", "supportVisuObj1B", "[", i, "]"))
473-
name5 = String(Symbol(world.path, ".", "supportVisuObj2B", "[", i, "]"))
474-
name6 = String(Symbol(world.path, ".", "supportVisuObj3B", "[", i, "]"))
469+
name1 = String(Symbol(world.path, ".", "supportVisuObj1A", i))
470+
name2 = String(Symbol(world.path, ".", "supportVisuObj2A", i))
471+
name3 = String(Symbol(world.path, ".", "supportVisuObj3A", i))
472+
name4 = String(Symbol(world.path, ".", "supportVisuObj1B", i))
473+
name5 = String(Symbol(world.path, ".", "supportVisuObj2B", i))
474+
name6 = String(Symbol(world.path, ".", "supportVisuObj3B", i))
475475

476476
featureA = Modia3D.Visual(shape = Modia3D.Sphere(diameter = defaultContactSphereDiameter), visualMaterial = Modia3D.VisualMaterial(color="Red", transparency=1.0))
477477

0 commit comments

Comments
 (0)