#đ cant run my script
70 messages · Page 1 of 1 (latest)
@jagged spindle
Remember to:
- Ask your Python question, not if you can ask or if there's an expert who can help.
- Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
- Explain what you expect to happen and what actually happens.
:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.
import cadquery as cq
MĂ„tt (i mm) â justera vid behov
inner_width = 20 # Bredd pÄ öglan
clip_thickness = 4 # Tjocklek pÄ klÀmman
clip_depth = 10 # Djup in i öglan
clip_length = 60 # LĂ€ngd som sticker ut
hook_radius = 10 # Radie pÄ skohornshÀngaren
Basdel som gÄr in i öglan
base = (
cq.Workplane("XY")
.box(inner_width, clip_thickness, clip_depth)
)
Kroppen som sticker ut
clip_body = (
cq.Workplane("XY")
.transformed(offset=(0, 0, clip_depth))
.box(inner_width, clip_thickness, clip_length)
)
Rund krok i Ànden
hook = (
cq.Workplane("XZ")
.transformed(offset=(0, clip_thickness/2, clip_depth + clip_length))
.threePointArc((0, 0, hook_radius * math.pi), (0, 0, hook_radius * 2 * math.pi))
.sweep(cq.Workplane("YZ").circle(inner_width / 2))
)
Kombinera allt
hanger = base.union(clip_body).union(hook)
Exportera till STL
cq.exporters.export(hanger, 'skohornshangare_clip.stl')
ther we go
read this
!code import cadquery as cq
MĂ„tt (i mm) â justera vid behov
inner_width = 20 # Bredd pÄ öglan
clip_thickness = 4 # Tjocklek pÄ klÀmman
clip_depth = 10 # Djup in i öglan
clip_length = 60 # LĂ€ngd som sticker ut
hook_radius = 10 # Radie pÄ skohornshÀngaren
Basdel som gÄr in i öglan
base = (
cq.Workplane("XY")
.box(inner_width, clip_thickness, clip_depth)
)
Kroppen som sticker ut
clip_body = (
cq.Workplane("XY")
.transformed(offset=(0, 0, clip_depth))
.box(inner_width, clip_thickness, clip_length)
)
Rund krok i Ànden
hook = (
cq.Workplane("XZ")
.transformed(offset=(0, clip_thickness/2, clip_depth + clip_length))
.threePointArc((0, 0, hook_radius * math.pi), (0, 0, hook_radius * 2 * math.pi))
.sweep(cq.Workplane("YZ").circle(inner_width / 2))
)
Kombinera allt
hanger = base.union(clip_body).union(hook)
Exportera till STL
cq.exporters.export(hanger, 'skohornshangare_clip.stl')
no. read it
and once read, you do what it shows and tells you to do. that way we can read your code here on discord
Please react with â
to upload your file(s) to our paste bin, which is more accessible for some users.
like that?
did you read the code tag?
i dont know pyhon
yes
and what does it say you should do?
MĂ„tt (i mm) â justera vid behov
inner_width = 20 # Bredd pÄ öglan
clip_thickness = 4 # Tjocklek pÄ klÀmman
clip_depth = 10 # Djup in i öglan
clip_length = 60 # LĂ€ngd som sticker ut
hook_radius = 10 # Radie pÄ skohornshÀngaren
Basdel som gÄr in i öglan
base = (
cq.Workplane("XY")
.box(inner_width, clip_thickness, clip_depth)
)
Kroppen som sticker ut
clip_body = (
cq.Workplane("XY")
.transformed(offset=(0, 0, clip_depth))
.box(inner_width, clip_thickness, clip_length)
)
Rund krok i Ànden
hook = (
cq.Workplane("XZ")
.transformed(offset=(0, clip_thickness/2, clip_depth + clip_length))
.threePointArc((0, 0, hook_radius * math.pi), (0, 0, hook_radius * 2 * math.pi))
.sweep(cq.Workplane("YZ").circle(inner_width / 2))
)
Kombinera allt
hanger = base.union(clip_body).union(hook)
Exportera till STL
cq.exporters.export(hanger, 'skohornshangare_clip.stl')
this is not python, this is just how discord works
aha
good.. you forgot the py part on line one
import cadquery as cq
MĂ„tt (i mm) â justera vid behov
inner_width = 20 # Bredd pÄ öglan
clip_thickness = 4 # Tjocklek pÄ klÀmman
clip_depth = 10 # Djup in i öglan
clip_length = 60 # LĂ€ngd som sticker ut
hook_radius = 10 # Radie pÄ skohornshÀngaren
Basdel som gÄr in i öglan
base = (
cq.Workplane("XY")
.box(inner_width, clip_thickness, clip_depth)
)
Kroppen som sticker ut
clip_body = (
cq.Workplane("XY")
.transformed(offset=(0, 0, clip_depth))
.box(inner_width, clip_thickness, clip_length)
)
Rund krok i Ànden
hook = (
cq.Workplane("XZ")
.transformed(offset=(0, clip_thickness/2, clip_depth + clip_length))
.threePointArc((0, 0, hook_radius * math.pi), (0, 0, hook_radius * 2 * math.pi))
.sweep(cq.Workplane("YZ").circle(inner_width / 2))
)
Kombinera allt
hanger = base.union(clip_body).union(hook)
Exportera till STL
cq.exporters.export(hanger, 'skohornshangare_clip.stl')
there you go
hahaha
now.. this is not python code, this is output from a gpt
but it is not the code output, you copied the text output
yes its swedish
i can see that, i meant its not code
notice you have # here
ok that understand why i could not paste and run it in freecad
so the gpt knows that human langauge needs it
its step per step oi see now
well thank u for all help i will kill my self for waste ur time ;P
the gpt model does not really know how to write code, so it does not know how to help you out
to run python code you need to have two things in place, in most of the cases
you have to have python installed, and you have to have any third party packages, like cadquery already installed before you run the code using it
its sounds so complicated for me, i think i will just cad it for scratch myself
i was hopping to save some time
true true, i wish i was smart to learn python
but dont have that mutch time over with work and wife
if you want to be able to save time in the long run, it requires short time investment up front
i dont think generative AI is a good choice when you have an expectation of its outcome beforehand, you kinda have to accept what you get
thats what makes AI such a poor tool when you want to do something exact, like programming
This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.