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
09b6ace4
Commit
09b6ace4
authored
2 years ago
by
Albert Dong
Browse files
Options
Downloads
Patches
Plain Diff
Copies working for multi-angle bead
parent
12e1b5ff
Branches
Branches containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
backend/beadGen.py
+9
-3
9 additions, 3 deletions
backend/beadGen.py
backend/main.py
+2
-1
2 additions, 1 deletion
backend/main.py
frontend/src/routes/spherical/+page.svelte
+1
-1
1 addition, 1 deletion
frontend/src/routes/spherical/+page.svelte
with
12 additions
and
5 deletions
backend/beadGen.py
+
9
−
3
View file @
09b6ace4
...
...
@@ -205,7 +205,7 @@ def generateSphere(radius: float, hole_radius: float, effective_angle: float, co
)
def
generateAngledBead
(
radius
,
hole_radius
,
angles
,
cutout_query
):
def
generateAngledBead
(
radius
,
hole_radius
,
angles
,
cutout_query
,
copies
):
ratio
=
0.88
sphere
=
Sphere
(
radius
)
bottom_cut
=
Pos
(
0
,
0
,
-
radius
*
4
/
3
)
*
Sphere
(
radius
)
...
...
@@ -242,5 +242,11 @@ def generateAngledBead(radius, hole_radius, angles, cutout_query):
)
bead
-=
Pos
(
radius
*
2
/
3
,
0
,
0
)
*
drain_hole
bead
-=
Pos
(
-
radius
*
2
/
3
,
0
,
0
)
*
drain_hole
return
(
tools
.
exportSTL
(
bead
,
"
angled-spherical-bead
"
,
1
),
bead
)
return
(
tools
.
exportSTL
(
tools
.
combineItemList
([
bead
]
*
copies
,
bead
.
bounding_box
().
diagonal
),
"
angled-spherical-bead
"
,
1
,
),
bead
,
)
This diff is collapsed.
Click to expand it.
backend/main.py
+
2
−
1
View file @
09b6ace4
...
...
@@ -153,10 +153,11 @@ def angled_sphere(
radius
:
Annotated
[
float
,
Query
(
gt
=
0
)],
hole_radius
:
Annotated
[
float
,
Query
(
gt
=
0
)],
angles
:
Annotated
[
list
[
float
],
Query
()],
copies
:
Annotated
[
int
,
Query
(
gt
=
0
)]
# cutoutQuery: Annotated[bool, Query()]
):
result
=
beadGen
.
generateAngledBead
(
radius
=
radius
,
hole_radius
=
hole_radius
,
angles
=
angles
,
cutout_query
=
False
radius
=
radius
,
hole_radius
=
hole_radius
,
angles
=
angles
,
cutout_query
=
False
,
copies
=
copies
)
filename
=
result
[
0
]
return
FileResponse
(
path
=
directory
+
filename
,
filename
=
filename
)
...
...
This diff is collapsed.
Click to expand it.
frontend/src/routes/spherical/+page.svelte
+
1
−
1
View file @
09b6ace4
...
...
@@ -38,7 +38,7 @@
}
else
if
(
bead_type
==
"
normal
"
)
{
api_path
=
`http://localhost:8000/api/sphere?radius=
${
radius
}
&hole_radius=
${
hole_radius
}
&effective_angle=
${
effective_angle
}
&copies=
${
copies
}
`
;
}
else
if
(
bead_type
==
"
multi
"
)
{
api_path
=
`http://localhost:8000/api/angled-sphere?radius=
${
radius
}
&hole_radius=
${
hole_radius
}
`
;
api_path
=
`http://localhost:8000/api/angled-sphere?radius=
${
radius
}
&hole_radius=
${
hole_radius
}
&copies=
${
copies
}
`
;
angles
.
forEach
((
angle
)
=>
{
api_path
+=
`&angles=
${
angle
}
`
;
});
...
...
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