FreeCAD is able to make similar thing found in OCCT documentation?

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
onekk
Veteran
Posts: 6098
Joined: Sat Jan 17, 2015 7:48 am
Contact:

FreeCAD is able to make similar thing found in OCCT documentation?

Post by onekk »

Hello

I've read some interesting documentation about OCCT, I'm speaking of this page:

https://dev.opencascade.org/doc/occt-7. ... algos.html

Around half of the document there is this code:

Changing radius

Code: Select all

void CSampleTopologicalOperationsDoc::OnEvolvedblend1() 
{ 
    TopoDS_Shape theBox  = BRepPrimAPI_MakeBox(200,200,200); 
    BRepFilletAPI_MakeFillet  Rake(theBox); 
    ChFi3d_FilletShape  FSh = ChFi3d_Rational; 
    Rake.SetFilletShape(FSh); 
    TColgp_Array1OfPnt2d  ParAndRad(1, 6); 
    ParAndRad(1).SetCoord(0.,  10.); 
    ParAndRad(1).SetCoord(50.,  20.); 
    ParAndRad(1).SetCoord(70.,  20.); 
    ParAndRad(1).SetCoord(130.,  60.); 
    ParAndRad(1).SetCoord(160.,  30.); 
    ParAndRad(1).SetCoord(200.,  20.); 
    TopExp_Explorer  ex(theBox,TopAbs_EDGE); 
    Rake.Add(ParAndRad, TopoDS::Edge(ex.Current())); 
    TopoDS_Shape  evolvedBox = Rake.Shape(); 
} 
It is possible to make similar thing in FreeCAD?

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: FreeCAD is able to make similar thing found in OCCT documentation?

Post by TheMarkster »

Werner recently added this evolve feature. This snippet is from the source code:

Code: Select all

import PartEnums
v = App.Vector
profile = Part.makePolygon([v(0.,0.,0.), v(-60.,-60.,-100.), v(-60.,-60.,-140.)])
spine = Part.makePolygon([v(0.,0.,0.), v(100.,0.,0.), v(100.,100.,0.), v(0.,100.,0.), v(0.,0.,0.)])
evolve = spine.makeEvolved(Profile=profile, Join=PartEnums.JoinType.Arc)

Then:

Code: Select all

Part.show(evolve)
There is also a Solid keyword for a solid.

Code: Select all

static char* kwds_evolve[] = {"Profile", "Join", "AxeProf", "Solid", "ProfOnSpine", "Tolerance", nullptr};
User avatar
onekk
Veteran
Posts: 6098
Joined: Sat Jan 17, 2015 7:48 am
Contact:

Re: FreeCAD is able to make similar thing found in OCCT documentation?

Post by onekk »

Tanks but it is a different thing.

I have seen evolve and I have some problems (due to my old brain) to catch the inner working.

I have to study it more in details.

This thing if you see the image in OCCT docs, will permit to makeca fillet specifing a different radius "evolution" along the edge.

Regards

Carlo D.
GitHub page: https://github.com/onekk/freecad-doc.
- In deep articles on FreeCAD.
- Learning how to model with scripting.
- Various other stuffs.

Blog: https://okkmkblog.wordpress.com/
TheMarkster
Veteran
Posts: 5505
Joined: Thu Apr 05, 2018 1:53 am

Re: FreeCAD is able to make similar thing found in OCCT documentation?

Post by TheMarkster »

Okay, yes this is different from what I was thinking of. No, I think the only fillets possible have either 1 or 2 radii defined per edge.
Post Reply