Create a Face from Non-Planar Wires

130 views
Skip to first unread message

CONNOR MORENO

unread,
Aug 26, 2024, 12:06:26 PM8/26/24
to CadQuery
Hello!

Is it possible to create a face from non-planar wires in CadQuery? I have a collection of splines, connected by a straight line, that I would like to use to create a face (see the attached image for an example). However, it seems that the cadquery.Face.makeFromWires method works only for planar wires and I cannot seem to find an alternative method that works. My end goal is to create a solid from these collections of wires and my plan was to use these wires to define faces, then to define a shell, and ultimately a solid.

Thanks and please let me know if any clarification is needed!

Connor

Screenshot 2024-08-26 at 10.57.48 AM.png

Jeremy Wright

unread,
Aug 26, 2024, 12:15:01 PM8/26/24
to CONNOR MORENO, CadQuery

--
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/a2804e73-c4e2-4030-b9bc-4f603c11112en%40googlegroups.com.

CONNOR MORENO

unread,
Aug 26, 2024, 12:30:53 PM8/26/24
to CadQuery
Hi Jeremy! Thanks for your quick response. I'm happy to give interpPlate a try! That said, can interpPlate be used with cadquery.Wire objects? The surf_edges parameter mentions that a "list of ordered or unordered wires" can be passed but when I try to pass my three wire objects, I receive the following error:

TypeError: Expected three floats, OCC gp_, or 3-tuple

CONNOR MORENO

unread,
Aug 26, 2024, 1:10:18 PM8/26/24
to CadQuery
Alternatively, when passing the coordinates used to define the wires to surf_edges, and coordinates at the midpoint between these edges to surf_pts, and using a thickness of zero,

face = cq.Solid.interpPlate(surface_edges, surface_pts, 0)

I receive the following error:

Traceback (most recent call last):
  File "/home/camoreno/Research/magnets_cq/magnets_from_wires.py", line 119, in <module>
    face = cq.Solid.interpPlate(
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/camoreno/miniforge3/envs/parastell_env/lib/python3.11/site-packages/cadquery/utils.py", line 41, in wrapped
    return f(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^
  File "/home/camoreno/miniforge3/envs/parastell_env/lib/python3.11/site-packages/cadquery/occ_impl/shapes.py", line 3025, in interpPlate
    face = Face.makeNSidedSurface(
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/camoreno/miniforge3/envs/parastell_env/lib/python3.11/site-packages/cadquery/occ_impl/shapes.py", line 2512, in makeNSidedSurface
    face = n_sided.Shape()
           ^^^^^^^^^^^^^^^
OCP.StdFail.StdFail_NotDone: BRep_API: command not done


Reply all
Reply to author
Forward
0 new messages