Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Tailorbird
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Künstlerische Gestaltung
Tailorbird
Commits
eed6fab1
Commit
eed6fab1
authored
2 years ago
by
Jakob Yanagibashi
Browse files
Options
Downloads
Patches
Plain Diff
Add vertical model and fix some things
parent
adbd1b07
No related branches found
No related tags found
No related merge requests found
Pipeline
#256725
passed
2 years ago
Stage: test
Stage: deploy
Changes
3
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
js/model.js
+6
-1
6 additions, 1 deletion
js/model.js
js/project.js
+7
-5
7 additions, 5 deletions
js/project.js
main.js
+18
-0
18 additions, 0 deletions
main.js
with
31 additions
and
6 deletions
js/model.js
+
6
−
1
View file @
eed6fab1
...
...
@@ -93,7 +93,12 @@ class Model {
e
:
0
,
};
for
(
let
i
=
commandArrayLength
;
i
>
0
;
i
--
)
{
currCoords
.
x
=
+
this
.
commands
[
commandArrayLength
-
1
].
goalx
.
value
;
currCoords
.
y
=
+
this
.
commands
[
commandArrayLength
-
1
].
goaly
.
value
;
currCoords
.
z
=
+
this
.
commands
[
commandArrayLength
-
1
].
goalz
.
value
;
currCoords
.
e
=
+
this
.
commands
[
commandArrayLength
-
1
].
flow
.
value
;
// TODO: Why is this checking so much stuff? Coordinates XYZE should always be set.
/*
if (currCoords.x == 0 && this.commands[commandArrayLength - 1].goalx) {
currCoords.x = +this.commands[commandArrayLength - 1].goalx;
currCoords.y = +this.commands[commandArrayLength - 1].goaly;
...
...
@@ -106,7 +111,7 @@ class Model {
currCoords.e = +this.commands[commandArrayLength - 1].flow;
} else {
return currCoords;
}
}
*/
}
return
currCoords
;
}
...
...
This diff is collapsed.
Click to expand it.
js/project.js
+
7
−
5
View file @
eed6fab1
...
...
@@ -101,18 +101,20 @@ class Project {
}
addLine
(
flow
,
speed
,
toX
,
toY
,
toZ
)
{
if
(
flow
>
this
.
model
.
currentCoordinates
().
f
)
{
flow
=
this
.
model
.
currentCoordinates
().
f
;
if
(
flow
<
this
.
model
.
currentCoordinates
().
e
)
{
flow
=
this
.
model
.
currentCoordinates
().
e
;
}
var
newLine
=
new
Move
(
flow
,
speed
,
toX
,
toY
,
toZ
);
window
.
currentProject
.
model
.
append
(
newLine
);
//window.currentProject.model.append(newLine);
this
.
model
.
append
(
newLine
);
}
addArc
(
flow
,
speed
,
size
,
directionXY
,
directionZ
,
curvature
)
{
const
prevCoords
=
this
.
model
.
currentCoordinates
();
var
nextStartHeight
=
0
;
const
steps
=
Math
.
min
(
size
,
50
);
const
flowStep
=
(
flow
-
prevCoords
.
e
)
/
steps
;
const
angle
=
90
;
const
prevCoords
=
this
.
model
.
currentCoordinates
();
for
(
var
i
=
0
;
i
<=
steps
;
i
++
)
{
var
sub_angle
=
(
i
/
steps
)
*
angle
*
0.017453292519943295
;
// (angle / 180) * Math.PI;
var
xi
=
size
*
(
1
-
Math
.
cos
(
sub_angle
));
...
...
@@ -173,7 +175,7 @@ class Project {
}
break
;
}
var
newMove
=
new
Move
(
flow
,
speed
,
newX
,
newY
,
newZ
);
var
newMove
=
new
Move
(
prevCoords
.
e
+
flowStep
*
i
,
speed
,
newX
,
newY
,
newZ
);
this
.
model
.
append
(
newMove
);
}
}
...
...
This diff is collapsed.
Click to expand it.
main.js
+
18
−
0
View file @
eed6fab1
...
...
@@ -448,6 +448,24 @@ function getPresetModelVase() {
function
getPresetModelVertical
()
{
var
presetProject
=
new
Project
();
var
extMult
=
4
;
var
ext
=
0
;
const
startX
=
40
;
var
currBig
;
var
currSmall
;
for
(
var
i
=
1
;
i
<
15
;
i
++
)
{
currBig
=
i
*
extMult
;
currSmall
=
i
*
extMult
-
extMult
/
2
;
presetProject
.
addLine
(
ext
,
1500
,
startX
-
currSmall
,
0
,
0
);
presetProject
.
addArc
(
ext
+=
currSmall
*
1.5
,
1500
,
currSmall
,
"
1
"
,
"
1
"
,
"
1
"
);
presetProject
.
addLine
(
ext
,
1500
,
startX
,
0
,
currBig
);
presetProject
.
addArc
(
ext
+=
currBig
*
1.5
,
1500
,
currBig
,
"
3
"
,
"
2
"
,
"
1
"
);
}
return
presetProject
;
}
...
...
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