Loft problem: Standard_ConstructionError: BRepFIll:: profiles are inconsistent

486 views
Skip to first unread message

Jaakko

unread,
Dec 29, 2021, 6:45:52 PM12/29/21
to CadQuery
Hello all,
I am trying to create a part where I am lofting from a face of a part to a circle that is in an angle relative to the face:

example.jpg
Code to produce the shape:
from cadquery import cq

import math



legDiameter = 15
baseSize= 40
height = 25
angle = 9

fillet = baseSize/6
thickness = 4
radius = (legDiameter/2)+thickness
legDist=baseSize*0.4-radius 


base = (cq.Workplane("XY")
        .rect(baseSize, baseSize, centered=True)
        .extrude(thickness)
        .rotate((0, 0, 0), (0, 0, 1), 45)
        )

loftWires = (base
        .edges("(|Z and (not >Y))")
        .fillet(fillet)
        .edges("(|Z and (>Y))")
        .fillet(radius+10 )
        .faces(">Z")
        .wires())
#debug(loftWires)
upperCircle = (loftWires
        .toPending()
        .workplane()
        .transformed(offset=cq.Vector(0, legDist, 0))
        .transformed(rotate=cq.Vector(-angle, 0, 45))
        .transformed(offset=cq.Vector(0, 0, height))
        .circle(radius))
#debug(loft)
loft = (upperCircle.loft(combine=True))
               


show_object(loft)

The problem:
If angle is changed from 9 to 10 the code fails with message: " Standard_ConstructionError: BRepFIll:: profiles are inconsistent"

Any ideas what could cause this and how I could avoid this?
I am trying to make customizable part where the said angle would be between 0-20

Jaakko

Jeremy Wright

unread,
Jan 4, 2022, 9:09:34 AM1/4/22
to CadQuery
The CAD kernel doesn't seem to be gracefully handling the compound rotation (in two axes) of the circle at the top.

If I change this:

.transformed(rotate=cq.Vector(-angle, 0, 45))

to this:

.transformed(rotate=cq.Vector(-angle, 0, 0))

I can vary the angle however I want (0 to 20 degrees).

You can see how things start to go very wrong if you decrease the 45 to 20 with 'angle' at 20.

.transformed(rotate=cq.Vector(-angle, 0, 20))

Screenshot from 2022-01-04 09-07-17.png

Dave Cowden

unread,
Jan 4, 2022, 11:30:56 AM1/4/22
to Jeremy Wright, CadQuery
FWIW NO cad kernel handles lofts with twist well. Even with Solidworks and a mouse , it never gets it right. exposing my ignorance, but does OCP/OCC allow supplying guide wires with lofts? 

--
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/ada5e1e8-8573-4ae8-ab52-325a5d233e65n%40googlegroups.com.

Adam Urbanczyk

unread,
Jan 4, 2022, 11:57:31 AM1/4/22
to CadQuery
You could try using multisection sweep. AFAICT loft is mostly meant for planar profiles.

Adam Urbanczyk

unread,
Jan 5, 2022, 11:50:59 AM1/5/22
to CadQuery
Here is an example based on your code:


from cadquery import cq
import math

legDiameter = 15
baseSize= 40
height = 25
angle = 45



fillet = baseSize/6
thickness = 4
radius = (legDiameter/2)+thickness
legDist=baseSize*0.4-radius


base = (
cq.Workplane("XY")
.rect(baseSize, baseSize, centered=True)
.extrude(thickness)
.rotate((0, 0, 0), (0, 0, 1), 45)
.edges("(|Z and (not >Y))")
.fillet(fillet)
.edges("(|Z and (>Y))")
.fillet(radius+10 )
)

upperCircle = (
base.faces('>Z')

.workplane()
.transformed(offset=cq.Vector(0, legDist, 0))
.transformed(rotate=cq.Vector(-angle, 0, 45))
.transformed(offset=cq.Vector(0, 0, height))
.circle(radius)
)

lw = base.faces(">Z").wires().val()
uc = upperCircle.val()
res = cq.Solid.sweep_multi((lw, uc), cq.Edge.makeLine(lw.Center(), uc.Center()))

show_object(base.union(res))
Reply all
Reply to author
Forward
0 new messages