Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
Amanda Ghassaei
DMDesign
Commits
d11ee567
Commit
d11ee567
authored
Sep 14, 2015
by
Amanda Ghassaei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lego part
parent
d2965f7e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
8 deletions
+52
-8
assets/stls/parts/LegoBrick1x1.stl
assets/stls/parts/LegoBrick1x1.stl
+0
-0
js/cells/GIKCell.js
js/cells/GIKCell.js
+21
-6
js/main.js
js/main.js
+1
-0
js/parts/LegoPart.js
js/parts/LegoPart.js
+28
-0
js/plists/PList.js
js/plists/PList.js
+2
-2
No files found.
assets/stls/parts/LegoBrick1x1.stl
View file @
d11ee567
No preview for this file type
js/cells/GIKCell.js
View file @
d11ee567
...
...
@@ -20,14 +20,29 @@ define(['underscore', 'three', 'threeModel', 'lattice', 'appState', 'cubeCell'],
var
self
=
this
;
var
parts
=
[];
if
(
lattice
.
get
(
"
partType
"
)
==
"
l
ego
"
)
{
require
([
'
gikPart
'
],
function
(
GIK
Part
){
parts
.
push
(
new
GIK
Part
(
self
.
index
.
x
,
self
));
if
(
lattice
.
get
(
"
partType
"
)
==
"
willL
ego
"
)
{
require
([
'
gikPart
'
],
function
(
Part
Subclass
){
parts
.
push
(
new
Part
Subclass
(
self
.
index
.
x
,
self
));
callback
(
parts
);
});
}
else
{
require
([
'
gikPartLowPoly
'
],
function
(
GIKPartLowPoly
){
parts
.
push
(
new
GIKPartLowPoly
(
self
.
index
.
x
,
self
));
}
else
if
(
lattice
.
get
(
"
partType
"
)
==
"
willLegoLowPoly
"
)
{
require
([
'
gikPartLowPoly
'
],
function
(
PartSubclass
){
parts
.
push
(
new
PartSubclass
(
self
.
index
.
x
,
self
));
callback
(
parts
);
});
}
else
if
(
lattice
.
get
(
"
partType
"
)
==
"
dnaLego
"
)
{
require
([
'
legoPart
'
],
function
(
PartSubclass
){
parts
.
push
(
new
PartSubclass
(
self
.
index
.
x
,
self
));
callback
(
parts
);
});
}
else
if
(
lattice
.
get
(
"
partType
"
)
==
"
lego
"
)
{
require
([
'
legoPart
'
],
function
(
PartSubclass
){
parts
.
push
(
new
PartSubclass
(
self
.
index
.
x
,
self
));
callback
(
parts
);
});
}
else
if
(
lattice
.
get
(
"
partType
"
)
==
"
dnaStraight
"
)
{
require
([
'
gikPartLowPoly
'
],
function
(
PartSubclass
){
parts
.
push
(
new
PartSubclass
(
self
.
index
.
x
,
self
));
callback
(
parts
);
});
}
...
...
js/main.js
View file @
d11ee567
...
...
@@ -107,6 +107,7 @@ require.config({
kennyTeqPart
:
'
parts/KennyTeqPart
'
,
kennyTeqHighResPart
:
'
parts/KennyTeqHighResPart
'
,
samTeqPart
:
'
parts/SamTeqPart
'
,
legoPart
:
'
parts/LegoPart
'
,
//materials
materials
:
'
materials/DMAMaterials
'
,
...
...
js/parts/LegoPart.js
0 → 100644
View file @
d11ee567
/**
* Created by aghassaei on 9/14/15.
*/
define
([
'
underscore
'
,
'
stlLoader
'
,
'
gikPart
'
,
'
bin!../assets/stls/parts/legoBrick1x1.stl
'
],
function
(
_
,
THREE
,
GIKPart
,
stl
){
var
loader
=
new
THREE
.
STLLoader
();
var
unitGeo
=
preProcessGeo
(
loader
.
parse
(
stl
));
function
preProcessGeo
(
geo
){
geo
.
computeBoundingBox
();
var
unitScale
=
1
/
(
8.2
);
geo
.
applyMatrix
(
new
THREE
.
Matrix4
().
makeScale
(
unitScale
,
unitScale
,
unitScale
));
return
geo
;
}
function
LegoPart
(
index
,
parent
){
GIKPart
.
call
(
this
,
index
,
parent
);
}
LegoPart
.
prototype
=
Object
.
create
(
GIKPart
.
prototype
);
LegoPart
.
prototype
.
_getGeometry
=
function
(){
return
unitGeo
;
};
return
LegoPart
;
});
\ No newline at end of file
js/plists/PList.js
View file @
d11ee567
...
...
@@ -224,10 +224,10 @@ define(['three'], function(THREE){
willGik
:
{
name
:
"
Electronic GIK Lattice
"
,
parts
:
{
l
ego
:
{
willL
ego
:
{
name
:
"
Micro LEGO (high res)
"
},
l
egoLowPoly
:
{
willL
egoLowPoly
:
{
name
:
"
Micro LEGO (low res)
"
}
},
...
...
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