# This is a CadQuery script template
# Add your script code below
import cadquery as cq
from cadquery import selectors
from Helpers import show
spoolWidth = 6 # spool thickness, front to back (half 20mm shaft)
spoolRadius = 35/2 # the outer dia the line wraps around
indexRadius = 3 # inner dia holes indexing pin(s) use to lock spool together
hexRadius = 45.5/2 # outer dia of the integral hex nut for tightening
hexWidth = 4 # thickness of integral hex nut
result = cq.Workplane("XY").circle(spoolRadius).extrude(spoolWidth)\
.faces("<Z").workplane().polygon(6, hexRadius*2).extrude(hexWidth)\
.faces("<Z").chamfer(hexWidth/2.01)
result2 = cq.Workplane("XY").polygon(6, hexRadius*2).extrude(hexWidth)\
.faces("|Z").chamfer(hexWidth/2.01)
# Use the following to render your model with grey RGB and no transparency
# show(my_model, (204, 204, 204, 0.0))
show(result)
show(result2)
---------------------------------------------------------
The "|Z" filter works in results2, but if I replace the second "<Z" in results with a bar it throws an error and doesn't compile. As far as I can tell the code is exactly the same and I should be able to replace result2 with the last half of result, except that "|Z" doesn't work in that spot.
Is there a parallel face for it to select at that point on the chain of result1?
--
cadquery home: https://github.com/dcowden/cadquery
post issues at https://github.com/dcowden/cadquery/issues
run it at home at : https://github.com/jmwright/cadquery-freecad-module
see it in action at http://www.parametricparts.com
---
You received this message because you are subscribed to the Google Groups "CadQuery" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cadquery+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/362c9602-3e56-4cec-91d2-fb3380e1bd1b%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
BRep_API: command not done
result = cq.Workplane("XY").circle(spoolRadius).extrude(spoolWidth)\
.faces("<Z").workplane().polygon(6, hexRadius*2).extrude(hexWidth)\
.faces("|Z").chamfer(0.5)
result = cq.Workplane("XY").circle(spoolRadius).extrude(spoolWidth)\
.faces("<Z").workplane().polygon(6, hexRadius*2).extrude(hexWidth)\
.faces(">Z").workplane().polygon(22, spoolRadius*2-5).vertices().hole(indexDia)\
.faces(">Z").workplane().hole(shaftDia)\
.faces("|Z").chamfer(.3999)
Now is there a way to select only the edges of the hex portion instead of all faces?
# This is a CadQuery script template
# Add your script code below
import cadquery as cq
from cadquery import selectors
from Helpers import show
# dimensions are off of ideal to account for printing errors
spoolWidth = 6 # spool thickness, front to back (half 20mm shaft)
spoolRadius = 35.5/2 # the outer dia the line wraps around
indexDia = 3.4 # inner dia holes indexing pin(s) use to lock spool together
hexRadius = 45.5/2 # outer dia of the integral hex nut for tightening
hexWidth = 4 # thickness of integral hex nut
shaftDia = 5.3 # outer dia of motor shaft
result = cq.Workplane("XY").circle(spoolRadius).extrude(spoolWidth)\
.faces("<Z").workplane().polygon(6, hexRadius*2).extrude(hexWidth)\
.faces(">Z").workplane().polygon(22, spoolRadius*2-5).vertices().hole(indexDia)\
.faces(">Z").workplane().hole(shaftDia)
# .faces("|Z").chamfer(.3999)
s = selectors.StringSyntaxSelector
#result = result.faces("<Z").fillet(.45)
result = result.faces(s("<Z")+s(">Z")).fillet(.45)
show(result)
Have you updated to the latest version (Github master) of the CadQuery FreeCAD module?
Go to the main Github page for the module and click the "Download Zip" link. The changes you're needing haven't been officially released yet, so you have to grab a current copy of master.
https://github.com/jmwright/cadquery-freecad-module/archive/master.zip
The last version in the changes.md file should be the version that you're using.