[FIXED] Ticket #6407 - python API access to 2d fillet OCC functionality
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Be nice to others! Respect the FreeCAD code of conduct!
Re: Ticket #6407 - python API access to 2d fillet OCC functionality
Updated thread title with issue #6407 and renamed thread for better comprehension
Alone you go faster. Together we go farther
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Please mark thread [Solved]
Want to contribute back to FC? Checkout:
'good first issues' | Open TODOs and FIXMEs | How to Help FreeCAD | How to report Bugs
Re: Ticket #6407 - python API access to 2d fillet OCC functionality
git commit b07be87677
Example:
Example:
Code: Select all
from FreeCAD import Base
# Defining the points
p1 = Base.Vector(0, 0, 0)
p2 = Base.Vector(5, 5, 0)
p3 = Base.Vector(-5, 5, 0)
ed1 = Part.makeLine(p3, p2)
ed2 = Part.makeLine(p2, p1)
pln = Part.Plane()
api = Part.ChFi2d.FilletAPI()
api.init(ed1, ed2, pln)
radius = 1
api.perform(radius)
fillet2d, ed1, ed2 = api.result(p2)
wire = Part.Wire([ed1, fillet2d, ed2])
Part.show(wire)
-
- Veteran
- Posts: 5513
- Joined: Thu Apr 05, 2018 1:53 am
Re: Ticket #6407 - python API access to 2d fillet OCC functionality
Would it be better to use pln = Part.Plane(p1, p2, p3) instead for a more general solution where all points are not already on the xy plane or does it not matter?wmayer wrote: ↑Sat May 28, 2022 9:22 am git commit b07be87677
Example:Code: Select all
from FreeCAD import Base # Defining the points p1 = Base.Vector(0, 0, 0) p2 = Base.Vector(5, 5, 0) p3 = Base.Vector(-5, 5, 0) ed1 = Part.makeLine(p3, p2) ed2 = Part.makeLine(p2, p1) pln = Part.Plane() api = Part.ChFi2d.FilletAPI() api.init(ed1, ed2, pln) radius = 1 api.perform(radius) fillet2d, ed1, ed2 = api.result(p2) wire = Part.Wire([ed1, fillet2d, ed2]) Part.show(wire)
Re: [FIXED] Ticket #6407 - python API access to 2d fillet OCC functionality
It doesn't matter in this case. A plane where p1,p2,p3 lie on that all have z=0 is the xy plane and that's created with Part.Plane(). But for the general case you are right.TheMarkster wrote: ↑Mon May 30, 2022 4:12 pm Would it be better to use pln = Part.Plane(p1, p2, p3) instead for a more general solution where all points are not already on the xy plane or does it not matter?