CadQuery / CadQuery/cadquery

Fill closed loop with a face - Continuity problem

Open
#1,865 2 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
Python
Stars
5.8k
Forks
541
Avg merge
3d 2h
Merged PRs (30d)
5

Description

Hi all,

I'm encountering an issue while trying to fill a closed loop of edges on a wing surface using the following command:

`pythonCopyEditface = cq.Face.makeNSidedSurface(edges=loop_edges, constraints=[], degree=2)`

The `loop_edges` form a closed boundary extracted from a lofted wing surface. The loop is typically composed of 5 to 6 edges. The resulting geometry is topologically valid, but when I inspect the generated face, particularly the isoparametric lines, it’s clear that the continuity is poor. The surface is not smoothly interpolated across the boundary.

I attempted to improve this using:

`face = cq.Face.makeNSidedSurface(edges=loop_edges, constraints=[], degree=3, continuity=GeomAbs_C1)`

However, this consistently fails with the error:

`Standard_ConstructionError: GeomRectangularTrimmedSurface:: U parameters out of range`

Has anyone successfully improved surface quality using `makeNSidedSurface` such loops, or is there an alternative method you’d recommend? My goal is to create a clean, smooth face for downstream shell modeling in a wingbox context.

Any insight would be greatly appreciated!

UPDATE: As it turns out, there is a feature called `cadquery.occ_impl.shapes.cap()` which does what I need. Unfortunately, upon trying multiple times, I either have CQ-Editor freeze and become unresponsive or receive an error `Standard_ConstructionError`.

Some code snippets in case that helps:

```
loop_edges = [edges[k] for k in matched_idxs]

# Make a wire (must be closed!)
wires = cq.Wire.combine(loop_edges)

wire = wires[0]

loop_hashes = {e.hashCode() for e in loop_edges}
neighbor_faces = []

for face in stitched_shell.Faces():
face_edge_hashes = {e.hashCode() for e in face.Edges()}
if loop_hashes & face_edge_hashes:
neighbor_faces.append(face)

context_shell = cq.Shell.makeShell(neighbor_faces)

wire = cq.Wire.assembleEdges(loop_edges)

face = cap(wire, `context_shell)`
```

I also tried using the loop edges themselves instead of the wire, still no luck.

Image
Image

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.