Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Bead Generation Site
Manage
Activity
Members
Labels
Plan
Issues
8
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Claire
Bead Generation Site
Commits
326c3e8c
Commit
326c3e8c
authored
2 years ago
by
Albert Dong
Browse files
Options
Downloads
Patches
Plain Diff
double sided working
parent
38658c34
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/beadGen.py
+7
-6
7 additions, 6 deletions
backend/beadGen.py
backend/main.py
+4
-3
4 additions, 3 deletions
backend/main.py
frontend/src/routes/double/+page.svelte
+0
-40
0 additions, 40 deletions
frontend/src/routes/double/+page.svelte
with
11 additions
and
49 deletions
backend/beadGen.py
+
7
−
6
View file @
326c3e8c
...
...
@@ -96,13 +96,8 @@ def generateDouble(
top_tip_angle
:
float
|
None
=
None
,
bottom_tip_angle
:
float
|
None
=
None
,
top_sphere_angles
:
list
[
float
]
|
None
=
None
,
bottom_sphere_angles
:
list
[
float
]
|
None
=
None
,
):
if
not
(
hole_radius
<
radius
and
(
top_tip_angle
or
top_sphere_angles
)
and
(
bottom_tip_angle
or
bottom_sphere_angles
)
):
if
not
(
hole_radius
<
radius
and
(
top_tip_angle
or
top_sphere_angles
)):
print
(
"
parameters missing or out of range
"
)
return
...
...
@@ -141,6 +136,12 @@ def generateDouble(
)
)
b
-=
sweep
(
sections
=
[
hole_shape
],
path
=
line
)
else
:
b
-=
extrude
(
to_extrude
=
hole_shape
,
amount
=
tip
.
faces
().
sort_by
(
SortBy
.
AREA
).
first
.
center
().
Z
,
both
=
True
,
)
return
(
tools
.
exportSTL
(
b
,
"
double-sided
"
,
1
),
b
)
...
...
This diff is collapsed.
Click to expand it.
backend/main.py
+
4
−
3
View file @
326c3e8c
...
...
@@ -99,7 +99,6 @@ def double_sided(
top_tip_angle
:
Annotated
[
float
|
None
,
Query
(
gt
=
0
,
lt
=
180
)]
=
None
,
bottom_tip_angle
:
Annotated
[
float
|
None
,
Query
(
gt
=
0
,
lt
=
180
)]
=
None
,
top_sphere_angles
:
Annotated
[
list
[
float
]
|
None
,
Query
()]
=
None
,
bottom_sphere_angles
:
Annotated
[
list
[
float
]
|
None
,
Query
()]
=
None
,
):
args
=
{
"
radius
"
:
radius
,
...
...
@@ -111,7 +110,6 @@ def double_sided(
"
top_tip_angle
"
:
top_tip_angle
,
"
bottom_tip_angle
"
:
bottom_tip_angle
,
"
top_sphere_angles
"
:
top_sphere_angles
,
"
bottom_sphere_angles
"
:
bottom_sphere_angles
,
}
for
k
,
v
in
cur_args
.
items
():
if
v
:
...
...
@@ -195,7 +193,10 @@ def polygon(
hole_radius
:
Annotated
[
float
,
Query
(
gt
=
0
)],
):
result
=
structureGen
.
polygonStructGen
(
num_sides
=
num_sides
,
side_length
=
side_length
,
beads_per_side
=
beads_per_side
,
hole_radius
=
hole_radius
num_sides
=
num_sides
,
side_length
=
side_length
,
beads_per_side
=
beads_per_side
,
hole_radius
=
hole_radius
,
)
filename
=
result
[
0
]
return
FileResponse
(
path
=
directory
+
filename
,
filename
=
filename
)
This diff is collapsed.
Click to expand it.
frontend/src/routes/double/+page.svelte
+
0
−
40
View file @
326c3e8c
...
...
@@ -22,9 +22,7 @@
let
top_cone_tip_angle
=
90
;
let
bottom_cone_tip_angle
=
90
;
let
top_sphere_angles
=
[
0
];
let
bottom_sphere_angles
=
[
0
];
let
top_current_angle_input
=
45
;
let
bottom_current_angle_input
=
45
;
let
api_path
:
string
;
$
:
{
...
...
@@ -38,10 +36,6 @@
}
if
(
bottom_type
==
"
cone
"
)
{
api_path
+=
`&bottom_tip_angle=
${
bottom_cone_tip_angle
}
`
;
}
else
{
bottom_sphere_angles
.
forEach
((
angle
)
=>
{
api_path
+=
`&bottom_sphere_angles=
${
angle
}
`
;
});
}
}
...
...
@@ -156,40 +150,6 @@
bind:value=
{
bottom_cone_tip_angle
}
/>
{
/if
}
{
#if
bottom_type
==
"
sphere
"
}
<label
for=
"angle-input"
>
Angle Editor
</label>
<div
class=
"flex flex-row"
>
<input
name=
"angle-input"
class=
"flex-1 h-10 min-w-0 bg-purple-100"
type=
"number"
bind:value=
{
bottom_current_angle_input
}
/>
<button
class=
"h-10 rounded-full w-1/4 bg-rose-300"
on:click=
{
()
=>
{
if
(
!
bottom_sphere_angles
.
includes
(
bottom_current_angle_input
))
{
bottom_sphere_angles
.
push
(
bottom_current_angle_input
);
bottom_sphere_angles
=
bottom_sphere_angles
;
}
}}
>
Add
</button>
<button
class=
"h-10 rounded-full w-1/4 bg-rose-500"
on:click=
{
()
=>
{
bottom_sphere_angles
=
[
0
];
}
}
>
Reset
</button>
</div>
<p>
Current Angles:
{
bottom_sphere_angles
}
</p>
{
/if
}
</div>
<button
class=
"h-10 rounded-full bg-green-500"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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