Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
DMDesign
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Amanda Ghassaei
DMDesign
Commits
29d65126
Commit
29d65126
authored
Sep 14, 2015
by
Amanda Ghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
starting to add nucleotides
parent
d11ee567
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
91 additions
and
8 deletions
+91
-8
js/cells/GIKCell.js
js/cells/GIKCell.js
+8
-2
js/main.js
js/main.js
+3
-1
js/parts/DMAPart.js
js/parts/DMAPart.js
+1
-1
js/parts/DNAStraightPart.js
js/parts/DNAStraightPart.js
+75
-0
js/parts/LegoPart.js
js/parts/LegoPart.js
+1
-1
js/plists/PList.js
js/plists/PList.js
+3
-3
No files found.
js/cells/GIKCell.js
View file @
29d65126
...
...
@@ -41,8 +41,14 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cubeCell'],
callback
(
parts
);
});
}
else
if
(
lattice
.
get
(
"
partType
"
)
==
"
dnaStraight
"
)
{
require
([
'
gikPartLowPoly
'
],
function
(
PartSubclass
){
parts
.
push
(
new
PartSubclass
(
self
.
index
.
x
,
self
));
require
([
'
dnaStraightPart
'
],
function
(
PartSubclass
){
for
(
var
i
=
0
;
i
<
16
;
i
++
){
parts
.
push
(
new
PartSubclass
(
self
.
index
.
x
,
self
,
{
vertIndex
:
i
,
isBridge
:
false
}));
}
parts
.
push
(
new
PartSubclass
(
self
.
index
.
x
,
self
,
{
isBridge
:
true
}));
callback
(
parts
);
});
}
...
...
js/main.js
View file @
29d65126
...
...
@@ -108,6 +108,7 @@ require.config({
kennyTeqHighResPart
:
'
parts/KennyTeqHighResPart
'
,
samTeqPart
:
'
parts/SamTeqPart
'
,
legoPart
:
'
parts/LegoPart
'
,
dnaStraightPart
:
'
parts/DNAStraightPart
'
,
//materials
materials
:
'
materials/DMAMaterials
'
,
...
...
@@ -212,7 +213,8 @@ require.config({
gikEndPartLowPolySTL
:
'
assets/stls/parts/GIKEndPartLowPoly.stl
'
,
kennyTeqPartSTL
:
'
assets/stls/parts/KennyTeqPart.stl
'
,
kennyTeqPartHighResSTL
:
'
assets/stls/parts/KennyTeqPartHighRes.stl
'
,
samTeqPartSTL
:
'
assets/stls/parts/SamTeqPart.stl
'
samTeqPartSTL
:
'
assets/stls/parts/SamTeqPart.stl
'
,
legoBrickSTL
:
'
assets/stls/parts/legoBrick1x1.stl
'
},
...
...
js/parts/DMAPart.js
View file @
29d65126
...
...
@@ -6,7 +6,7 @@
define
([
'
underscore
'
,
'
three
'
],
function
(
_
,
THREE
){
function
DMAPart
(
index
,
parent
)
{
function
DMAPart
(
index
,
parent
,
options
)
{
this
.
parentCell
=
parent
;
this
.
index
=
index
;
this
.
mesh
=
this
.
_buildMesh
();
...
...
js/parts/DNAStraightPart.js
0 → 100644
View file @
29d65126
/**
* Created by aghassaei on 9/14/15.
*/
define
([
'
underscore
'
,
'
stlLoader
'
,
'
gikPart
'
],
function
(
_
,
THREE
,
GIKPart
){
var
zScale
=
1
/
8
;
var
unitGeo
=
new
THREE
.
BoxGeometry
(
0.2
,
0.2
,
zScale
);
var
bridgeGeo
=
new
THREE
.
BoxGeometry
(
0.3
,
0.4
,
zScale
);
var
bridgeMaterial
=
new
THREE
.
MeshLambertMaterial
({
color
:
'
#000000
'
});
var
nuclMaterials
=
{
a
:
new
THREE
.
MeshLambertMaterial
({
color
:
"
#cc00cc
"
}),
t
:
new
THREE
.
MeshLambertMaterial
({
color
:
"
#ff6600
"
}),
c
:
new
THREE
.
MeshLambertMaterial
({
color
:
"
#66ffff
"
}),
g
:
new
THREE
.
MeshLambertMaterial
({
color
:
"
#00ff33
"
})
};
function
DNAStraightPart
(
index
,
parent
,
options
){
this
.
_isBridge
=
options
.
isBridge
;
if
(
!
this
.
_isBridge
){
this
.
_vertIndex
=
options
.
vertIndex
;
if
(
!
options
.
nuclType
)
this
.
_nuclType
=
this
.
_randomNucleotide
();
else
this
.
_nuclType
=
options
.
nuclType
;
}
GIKPart
.
call
(
this
,
index
,
parent
,
options
);
}
DNAStraightPart
.
prototype
=
Object
.
create
(
GIKPart
.
prototype
);
DNAStraightPart
.
prototype
.
_randomNucleotide
=
function
(){
var
rand
=
Math
.
random
();
if
(
rand
<
0.25
)
return
'
a
'
;
if
(
rand
<
0.5
)
return
'
t
'
;
if
(
rand
<
0.75
)
return
'
c
'
;
return
'
g
'
;
};
DNAStraightPart
.
prototype
.
_getGeometry
=
function
(){
if
(
this
.
_isBridge
)
return
bridgeGeo
;
return
unitGeo
;
};
DNAStraightPart
.
prototype
.
getMaterial
=
function
(
returnTHREEObject
){
if
(
returnTHREEObject
)
{
if
(
this
.
_isBridge
)
return
bridgeMaterial
;
return
nuclMaterials
[
this
.
_nuclType
];
}
return
GIKPart
.
prototype
.
getMaterial
.
call
(
this
,
returnTHREEObject
);
};
DNAStraightPart
.
prototype
.
_translatePart
=
function
(
mesh
){
if
(
this
.
_isBridge
){
mesh
.
translateX
(
0.15
+
0.2
);
mesh
.
translateZ
(
this
.
parentCell
.
zScale
()
/
2
-
zScale
/
2
);
return
mesh
;
}
var
xOffset
=
0.1
;
var
yOffset
=
-
0.1
;
if
(
this
.
index
==
1
)
{
xOffset
=
-
0.1
;
yOffset
=
0.1
;
}
mesh
.
position
.
set
(
xOffset
,
yOffset
,
this
.
parentCell
.
zScale
()
/
2
-
zScale
/
2
-
this
.
_vertIndex
*
zScale
);
return
mesh
;
};
return
DNAStraightPart
;
});
\ No newline at end of file
js/parts/LegoPart.js
View file @
29d65126
...
...
@@ -3,7 +3,7 @@
*/
define
([
'
underscore
'
,
'
stlLoader
'
,
'
gikPart
'
,
'
bin!
../assets/stls/parts/legoBrick1x1.stl
'
],
function
(
_
,
THREE
,
GIKPart
,
stl
){
define
([
'
underscore
'
,
'
stlLoader
'
,
'
gikPart
'
,
'
bin!
legoBrickSTL
'
],
function
(
_
,
THREE
,
GIKPart
,
stl
){
var
loader
=
new
THREE
.
STLLoader
();
var
unitGeo
=
preProcessGeo
(
loader
.
parse
(
stl
));
...
...
js/plists/PList.js
View file @
29d65126
...
...
@@ -254,11 +254,11 @@ define(['three'], function(THREE){
dnaBricks
:
{
name
:
"
DNA Bricks
"
,
parts
:
{
dnaLego
:
{
name
:
"
Lego Blocks
"
},
dnaStraight
:
{
name
:
"
DNA (straight chains)
"
},
dnaLego
:
{
name
:
"
Lego Blocks
"
}
},
aspectRatio
:
new
THREE
.
Vector3
(
1
,
1
,
1
),
...
...
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