I am trying to model a basic shoe but I am running into challenges figuring out how to use splines to create a 3D surface that I can extrude from the sole to the opening at the top (for the sides of the shoe). I'm getting an error saying: "ValueError: More than one wire is required" but I am not sure how to make a wire from an edge. In general, I am looking for examples of using splines as wires that can be extruded or lofted. I was also looking for example of how to use splines as Bezier curves, with XYZ vertices that each have "handles" you use to change the weight?


Extrude/Loft: I have two splines that I am trying to loft the one from the other. Apparently the splines are not "wires". How do you make a loft from two or more, 3D, splines? I can make 3D line splines, I just don't know how to use it

Spline: I saw this example in the "examples" section but I am specifically looking for an example of how to use the tangents and parameters to control the shape of the lines.

--
cadquery home: https://github.com/CadQuery/cadquery
post issues at https://github.com/CadQuery/cadquery/issues
run it at home at : https://github.com/CadQuery/CQ-editor
---
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/13989b33-edcd-465a-ba65-f8ef41eece24n%40googlegroups.com.
Hi Roger,
Thanks so much! It would have taken me a long time to figure this out. The challenge I am facing now is how to add volume to the side of the shoe. I made an inner and outer wall (see below), but I am stuck on how to span the two together. Is there a way to use the extrudeLinear function? I am still stuck on how to go between the API layers to select wires from a solid.
Thanks!

To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/75f4f651-b86a-43c4-9c55-76e6ad84acf3n%40googlegroups.com.
Thanks, I think the interPlate is what I need, however I am not sure how to format the lists. I tried using a list of xyz coordinates for both the first and second parameters, a list of wires for the first and xyz coordinates for the second, and only including the first parameter and leaving the second out (aka: [] ). They all produced errors that it is not abundantly clear how to resolve them:
All xyz coordinates error:
top = cq.Solid.interpPlate(
[(0, 160, 80),(-8, 130, 105),(-70, 80, 110),(0, 0, 110),(30, 80, 110),(8, 130, 105),(0, 160, 80),
(0, 375, 0),(-85, 330, 0),(-80, 151.5, 0),(-85, 0,
0),(0, 0, 0),(110, 0, 0),(120, 151.5, 0),(110, 330, 0),(0, 375, 0),],
[(0, 335, 0),(-80, 325, 0),(-75, 151.5, 0),(-80, 5,
0),(0, 5, 0),(105, 5, 0),(115, 151.5, 0),(105, 325, 0),(0, 335, 0),
(0, 155, 80),(-4, 127, 105),(-65, 80, 110),(0, 5, 110),(25, 80, 110),(4, 127, 105),(0, 155, 80)],
5
)
---------------------------------------------------------------------------
StdFail_NotDone Traceback (most recent call last)
<ipython-input-23-81de8825280e> in <module>
10 sole_inner_edge = cq.Edge.makeSpline([cq.Vector(p) for p in soleInnerDim])
11 print(f"{type(opening_outer_edge)=},{type(sole_outer_edge)=}")
---> 12 top = cq.Solid.interpPlate(
13 # [cq.Wire.assembleEdges([sole_outer_edge]), cq.Wire.assembleEdges([opening_outer_edge])],
14 [(0, 160, 80),(-8, 130, 105),(-70, 80, 110),(0, 0, 110),(30, 80, 110),(8, 130, 105),(0, 160, 80),
E:\anaconda\envs\python397\lib\site-packages\cadquery\occ_impl\shapes.py in interpPlate(cls, surf_edges, surf_pts, thickness, degree, nbPtsOnCur, nbIter, anisotropy, tol2d, tol3d, tolAng, tolCurv, maxDeg, maxSegments)
2673 # MAKE SURFACE
2674 continuity = GeomAbs_C0 # Fixed, changing to anything else crashes.
-> 2675 face = Face.makeNSidedSurface(
2676 edges,
2677 pts_array,
E:\anaconda\envs\python397\lib\site-packages\cadquery\occ_impl\shapes.py in makeNSidedSurface(cls, edges, points, continuity, degree, nbPtsOnCur, nbIter, anisotropy, tol2d, tol3d, tolAng, tolCurv, maxDeg, maxSegments)
2207 n_sided.Add(pt)
2208 n_sided.Build()
-> 2209 face = n_sided.Shape()
2210 return Face(face).fix()
2211
StdFail_NotDone: BRep_API: command not done
1st wire 2nd xyz error:
top = cq.Solid.interpPlate(
[cq.Wire.assembleEdges([sole_outer_edge]), cq.Wire.assembleEdges([opening_outer_edge])],
[(0, 335, 0),(-80, 325, 0),(-75, 151.5, 0),(-80, 5, 0),(0, 5, 0),(105, 5, 0),(115, 151.5, 0),(105, 325, 0),(0, 335, 0),
(0, 155, 80),(-4, 127, 105),(-65, 80, 110),(0, 5, 110),(25, 80, 110),(4, 127, 105),(0, 155, 80)],
5
)
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-24-4b99b1181a45> in <module>
12 # [(0, 160, 80),(-8, 130, 105),(-70, 80, 110),(0, 0, 110),(30, 80, 110),(8, 130, 105),(0, 160, 80),
13 # (0, 375, 0),(-85, 330, 0),(-80, 151.5, 0),(-85, 0, 0),(0, 0, 0),(110, 0, 0),(120, 151.5, 0),(110, 330, 0),(0, 375, 0),],
---> 14 top = cq.Solid.interpPlate(
15 [cq.Wire.assembleEdges([sole_outer_edge]), cq.Wire.assembleEdges([opening_outer_edge])],
16 [(0, 335, 0),(-80, 325, 0),(-75, 151.5, 0),(-80, 5, 0),(0, 5, 0),(105, 5, 0),(115, 151.5, 0),(105, 325, 0),(0, 335, 0),
E:\anaconda\envs\python397\lib\site-packages\cadquery\occ_impl\shapes.py in interpPlate(cls, surf_edges, surf_pts, thickness, degree, nbPtsOnCur, nbIter, anisotropy, tol2d, tol3d, tolAng, tolCurv, maxDeg, maxSegments)
2662 # If a list of (x,y,z) points provided, build closed polygon
2663 if isinstance(surf_edges, list):
-> 2664 e_array = [Vector(*e) for e in surf_edges]
2665 wire_builder = BRepBuilderAPI_MakePolygon()
2666 for e in e_array: # Create polygon from edges
E:\anaconda\envs\python397\lib\site-packages\cadquery\occ_impl\shapes.py in <listcomp>(.0)
2662 # If a list of (x,y,z) points provided, build closed polygon
2663 if isinstance(surf_edges, list):
-> 2664 e_array = [Vector(*e) for e in surf_edges]
2665 wire_builder = BRepBuilderAPI_MakePolygon()
2666 for e in e_array: # Create polygon from edges
TypeError: cadquery.occ_impl.geom.Vector() argument after * must be an iterable, not Wire
Just 1st xyz error:
top = cq.Solid.interpPlate(
[(0, 160, 80),(-8, 130, 105),(-70, 80, 110),(0, 0, 110),(30, 80, 110),(8, 130, 105),(0, 160, 80),
(0, 375, 0),(-85, 330, 0),(-80, 151.5, 0),(-85, 0, 0),(0, 0, 0),(110, 0, 0),(120, 151.5, 0),(110, 330, 0),(0, 375, 0),],
[],
5
)
---------------------------------------------------------------------------
Standard_NoSuchObject Traceback (most recent call last)
<ipython-input-26-090a4ce16f6d> in <module>
14 # (0, 155, 80),(-4, 127, 105),(-65, 80, 110),(0, 5, 110),(25, 80, 110),(4, 127, 105),(0, 155, 80)],
15 # [cq.Wire.assembleEdges([sole_outer_edge]), cq.Wire.assembleEdges([opening_outer_edge])],
---> 16 top = cq.Solid.interpPlate(
17 [(0, 160, 80),(-8, 130, 105),(-70, 80, 110),(0, 0, 110),(30, 80, 110),(8, 130, 105),(0, 160, 80),
18 (0, 375, 0),(-85, 330, 0),(-80, 151.5, 0),(-85, 0, 0),(0, 0, 0),(110, 0, 0),(120, 151.5, 0),(110, 330, 0),(0, 375, 0),],
E:\anaconda\envs\python397\lib\site-packages\cadquery\occ_impl\shapes.py in interpPlate(cls, surf_edges, surf_pts, thickness, degree, nbPtsOnCur, nbIter, anisotropy, tol2d, tol3d, tolAng, tolCurv, maxDeg, maxSegments)
2673 # MAKE SURFACE
2674 continuity = GeomAbs_C0 # Fixed, changing to anything else crashes.
-> 2675 face = Face.makeNSidedSurface(
2676 edges,
2677 pts_array,
E:\anaconda\envs\python397\lib\site-packages\cadquery\occ_impl\shapes.py in makeNSidedSurface(cls, edges, points, continuity, degree, nbPtsOnCur, nbIter, anisotropy, tol2d, tol3d, tolAng, tolCurv, maxDeg, maxSegments)
2206 for pt in points:
2207 n_sided.Add(pt)
-> 2208 n_sided.Build()
2209 face = n_sided.Shape()
2210 return Face(face).fix()
Standard_NoSuchObject: NCollection_BaseList::PRemove
The full code:
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/acc169af-5740-4799-8b3d-ac673691af11n%40googlegroups.com.
--------------------------------------------------------------------------- ValueError Traceback (most recent call last) <ipython-input-25-00979b1c0e38> in <module> 63 soleOuterDim.append((0, 375, 0)) 64 sole=cq.Workplane('XY').spline(soleOuterDim).close().extrude(-12) #.workplane('XY').polyline(treadDim).close() ---> 65 sole=sole.cut(tread_wire).clean() #this obviously doesn't work because it is not a surface 66 shoe=( 67 Assembly(sole,loc=Location(Vector(0,0,0)),color=Color(0, 0, 0, 1)) E:\anaconda\envs\python397\lib\site-packages\cadquery\cq.py in cut(self, toCut, clean) 3348 solidToCut = (toCut,) 3349 else: -> 3350 raise ValueError("Cannot cut type '{}'".format(type(toCut))) 3351 3352 newS = solidRef.cut(*solidToCut) ValueError: Cannot cut type '<class 'cadquery.occ_impl.shapes.Wire'>'


Aaron E-J
You received this message because you are subscribed to a topic in the Google Groups "CadQuery" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/cadquery/Zk1GuvDjkOE/unsubscribe.
To unsubscribe from this group and all its topics, send an email to cadquery+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/CACPJjBL1ymW7E7b7nYBDF_2OY_e4PjkkbW4FEmHtpXKuguj2Mw%40mail.gmail.com.
Alright, I realized I needed to add a vector to indicate the normal that the solid should be extruded through, but now I am getting "ValueError: Cannot build face(s): wires not planar"
tread=cq.Solid.extrudeLinear(tread_wire,[sole_wire],cq.Vector(0,0,-1))
--
cadquery home: https://github.com/CadQuery/cadquery
post issues at https://github.com/CadQuery/cadquery/issues
run it at home at : https://github.com/CadQuery/CQ-editor
---
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/007432bf-60e8-45ed-9fa0-cee8b507f5b4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cadquery/cece64ae-794c-44e3-9d10-e3abba6e6361n%40googlegroups.com.
