Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DMDesign
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Amanda Ghassaei
DMDesign
Commits
ce846a22
Commit
ce846a22
authored
10 years ago
by
Amanda Ghassaei
Browse files
Options
Downloads
Patches
Plain Diff
init part geometry
parent
350a1812
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
js/fea/dmaNode.js
+1
-1
1 addition, 1 deletion
js/fea/dmaNode.js
js/fea/dmaPart.js
+23
-13
23 additions, 13 deletions
js/fea/dmaPart.js
js/main.js
+13
-0
13 additions, 0 deletions
js/main.js
main.html
+1
-1
1 addition, 1 deletion
main.html
with
38 additions
and
15 deletions
js/fea/dmaNode.js
+
1
−
1
View file @
ce846a22
...
...
@@ -14,7 +14,7 @@ BeamNode.prototype.addBeam = function(beam){
BeamNode
.
prototype
.
render
=
function
(){
var
geometry
=
new
THREE
.
Sphere
Geometry
(
2
);
var
geometry
=
new
THREE
.
Box
Geometry
(
2
,
2
,
2
);
geometry
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeTranslation
(
this
.
x
,
this
.
y
,
this
.
z
)
);
var
mesh
=
new
THREE
.
Mesh
(
geometry
);
...
...
This diff is collapsed.
Click to expand it.
js/fea/dmaPart.js
+
23
−
13
View file @
ce846a22
...
...
@@ -5,12 +5,16 @@
//a part, element with a single material, handled by assembler
function
Part
(
nodes
,
config
)
{
//list of nodes, config tells how nodes are connected
this
.
nodes
=
nodes
;
this
.
beams
=
this
.
_createBeams
(
nodes
,
config
);
};
Part
.
prototype
.
_createBeams
=
function
(
nodes
,
config
){
function
DmaPart
(
geometry
)
{
//list of nodes, config tells how nodes are connected
// this.nodes = nodes;
// this.beams = this._createBeams(nodes, config);
this
.
geometry
=
geometry
;
this
.
render
();
}
DmaPart
.
prototype
.
_createBeams
=
function
(
nodes
,
config
){
var
beams
=
[];
_
.
each
(
config
,
function
(
pair
){
beams
.
push
(
new
Beam
(
nodes
[
pair
[
0
]],
nodes
[
pair
[
2
]]));
...
...
@@ -18,21 +22,27 @@ Part.prototype._createBeams = function(nodes, config){
return
beams
;
};
Part
.
prototype
.
render
=
function
(
scene
){
DmaPart
.
prototype
.
render
=
function
(){
var
mesh
=
new
THREE
.
Mesh
(
this
.
geometry
);
window
.
three
.
sceneAdd
(
mesh
);
window
.
three
.
render
();
};
Part
.
prototype
.
translate
=
function
(
dx
,
dy
,
dz
){
Dma
Part
.
prototype
.
translate
=
function
(
dx
,
dy
,
dz
){
};
Part
.
prototype
.
rotate
=
function
(
rx
,
ry
,
rz
){
Dma
Part
.
prototype
.
rotate
=
function
(
rx
,
ry
,
rz
){
};
//////////////////////////////////////////////////////////////
/////////////////SUBCLASSES///////////////////////////////////
//////////////////////////////////////////////////////////////
//matt's part
function
PartTriangle
(
nodes
){
}
PartTriangle
.
prototype
=
new
Part
(
nodes
,
[[
0
,
1
],[
1
,
2
],[
2
,
0
]]);
\ No newline at end of file
////matt's part
//function PartTriangle(){
//}
//
//PartTriangle.prototype = new DmaPart();
\ No newline at end of file
This diff is collapsed.
Click to expand it.
js/main.js
+
13
−
0
View file @
ce846a22
...
...
@@ -26,5 +26,18 @@ $(function(){
var
threeView
=
new
ThreeView
({
model
:
threeModel
,
highlightTargets
:
highlightTargets
});
//first, pre load the stl
part_loadSTL
();
function
part_loadSTL
(){
var
loader
=
new
THREE
.
STLLoader
();
loader
.
addEventListener
(
'
load
'
,
part_onMeshLoad
);
loader
.
load
(
'
data/Airbus_A300-600.stl
'
);
}
function
part_onMeshLoad
(
e
){
new
DmaPart
(
e
.
content
);
}
setupNavBar
(
threeModel
);
});
This diff is collapsed.
Click to expand it.
main.html
+
1
−
1
View file @
ce846a22
...
...
@@ -41,7 +41,7 @@
<!--fea stuff-->
<script
src=
"js/fea/dmaCell.js"
></script>
<!--
<script src="js/fea/dmaPart.js"></script>
-->
<script
src=
"js/fea/dmaPart.js"
></script>
<!--<script src="js/fea/dmaBeam.js"></script>-->
<script
src=
"js/fea/dmaNode.js"
></script>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment