Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
freecad_x3d
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Elphel
freecad_x3d
Commits
e27c2935
Commit
e27c2935
authored
Dec 09, 2015
by
Andrey Filippov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added assembly model transform node
parent
410cf0e2
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
x3d_step_assy.py
x3d_step_assy.py
+6
-1
No files found.
x3d_step_assy.py
View file @
e27c2935
...
...
@@ -523,6 +523,11 @@ def generateAssemblyX3d(assembly_path, components = None, dir_list = DIR_LIST, c
inlineNode
.
set
(
'url'
,
assName
+
'_config'
+
X3D_EXT
)
inlineNode
.
set
(
'nameSpaceName'
,
assName
)
modelNode
=
et
.
SubElement
(
sceneNode
,
'Transform'
)
modelNode
.
set
(
'id'
,
'transform_'
+
assName
)
modelNode
.
set
(
'translation'
,
'
%
f
%
f
%
f'
%
(
0
,
0
,
0
))
modelNode
.
set
(
'rotation'
,
'
%
f
%
f
%
f
%
f'
%
(
0
,
0
,
0
,
0
))
defined_parts
=
{}
# for each defined part holds index (for ID generation)
for
i
,
component
in
enumerate
(
components
[
'objects'
]):
parts
=
components
[
'candidates'
][
i
]
...
...
@@ -544,7 +549,7 @@ def generateAssemblyX3d(assembly_path, components = None, dir_list = DIR_LIST, c
defined_parts
[
part
]
+=
1
else
:
defined_parts
[
part
]
=
0
switchNode
=
et
.
SubElement
(
scene
Node
,
'Switch'
)
switchNode
=
et
.
SubElement
(
model
Node
,
'Switch'
)
switchNode
.
set
(
'id'
,
'switch_'
+
part
+
":"
+
str
(
defined_parts
[
part
]))
switchNode
.
set
(
'class'
,
'switch_'
+
part
)
switchNode
.
set
(
'whichChoice'
,
'0'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment