BRL-CAD Fillet and Thickness

Have some feature requests, feedback, cool stuff to share, or want to know where FreeCAD is going? This is the place.
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Post Reply
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

BRL-CAD Fillet and Thickness

Post by freecad-heini-1 »

OpenCASCADE currently has no developers who can reprogram and improve Fillet and Thickness.

My question. Is it possible to integrate such features from a different geometry core? For example from BRL-CAD?

Does anyone know about BRL-CAD?
If so, how useful is Fillet and Thickness?
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: BRL-CAD Fillet and Thickness

Post by vocx »

freecad-heini-1 wrote: Sun Dec 29, 2019 10:35 am OpenCASCADE currently has no developers who can reprogram and improve Fillet and Thickness.

My question. Is it possible to integrate such features from a different geometry core? For example from BRL-CAD?

Does anyone know about BRL-CAD?
If so, how useful is Fillet and Thickness?
I think Yorik is in contact with guys from BRL-CAD.

However, using the algorithms from another project instead of OCCT? That sounds like a difficult task. I don't think that would be simple. You'd need to use classes that are compatible with the rest of our code. Maybe you wouldn't simply use a new Fillet algorithm, but an entire new Shape class, which needs its own set of properties and methods.

See the code in Part.

It uses OCCT's "BRepFilletAPI_MakeFillet", and stores the result in a "TopoDS_Shape", with a bunch of other OCCT functions.

https://github.com/FreeCAD/FreeCAD/blob ... pp#L56-L86

Code: Select all

    try {
#if defined(__GNUC__) && defined (FC_OS_LINUX)
        Base::SignalException se;
#endif
        BRepFilletAPI_MakeFillet mkFillet(baseShape);
        TopTools_IndexedMapOfShape mapOfShape;
        TopExp::MapShapes(baseShape, TopAbs_EDGE, mapOfShape);


        std::vector<FilletElement> values = Edges.getValues();
        for (std::vector<FilletElement>::iterator it = values.begin(); it != values.end(); ++it) {
            int id = it->edgeid;
            double radius1 = it->radius1;
            double radius2 = it->radius2;
            const TopoDS_Edge& edge = TopoDS::Edge(mapOfShape.FindKey(id));
            mkFillet.Add(radius1, radius2, edge);
        }


        TopoDS_Shape shape = mkFillet.Shape();
        if (shape.IsNull())
            return new App::DocumentObjectExecReturn("Resulting shape is null");
        ShapeHistory history = buildHistory(mkFillet, TopAbs_FACE, shape, baseShape);
        this->Shape.setValue(shape);


        // make sure the 'PropertyShapeHistory' is not safed in undo/redo (#0001889)
        PropertyShapeHistory prop;
        prop.setValue(history);
        prop.setContainer(this);
        prop.touch();


        return App::DocumentObject::StdReturn;
    }
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: BRL-CAD Fillet and Thickness

Post by freecad-heini-1 »

vocx wrote: Mon Dec 30, 2019 12:15 am
freecad-heini-1 wrote: Sun Dec 29, 2019 10:35 am OpenCASCADE currently has no developers who can reprogram and improve Fillet and Thickness.

My question. Is it possible to integrate such features from a different geometry core? For example from BRL-CAD?

Does anyone know about BRL-CAD?
If so, how useful is Fillet and Thickness?
I think Yorik is in contact with guys from BRL-CAD.

However, using the algorithms from another project instead of OCCT? That sounds like a difficult task. I don't think that would be simple. You'd need to use classes that are compatible with the rest of our code. Maybe you wouldn't simply use a new Fillet algorithm, but an entire new Shape class, which needs its own set of properties and methods.

See the code in Part.

It uses OCCT's "BRepFilletAPI_MakeFillet", and stores the result in a "TopoDS_Shape", with a bunch of other OCCT functions.

https://github.com/FreeCAD/FreeCAD/blob ... pp#L56-L86

Code: Select all

    try {
#if defined(__GNUC__) && defined (FC_OS_LINUX)
        Base::SignalException se;
#endif
        BRepFilletAPI_MakeFillet mkFillet(baseShape);
        TopTools_IndexedMapOfShape mapOfShape;
        TopExp::MapShapes(baseShape, TopAbs_EDGE, mapOfShape);


        std::vector<FilletElement> values = Edges.getValues();
        for (std::vector<FilletElement>::iterator it = values.begin(); it != values.end(); ++it) {
            int id = it->edgeid;
            double radius1 = it->radius1;
            double radius2 = it->radius2;
            const TopoDS_Edge& edge = TopoDS::Edge(mapOfShape.FindKey(id));
            mkFillet.Add(radius1, radius2, edge);
        }


        TopoDS_Shape shape = mkFillet.Shape();
        if (shape.IsNull())
            return new App::DocumentObjectExecReturn("Resulting shape is null");
        ShapeHistory history = buildHistory(mkFillet, TopAbs_FACE, shape, baseShape);
        this->Shape.setValue(shape);


        // make sure the 'PropertyShapeHistory' is not safed in undo/redo (#0001889)
        PropertyShapeHistory prop;
        prop.setValue(history);
        prop.setContainer(this);
        prop.touch();


        return App::DocumentObject::StdReturn;
    }
Hello vocx,
Thank you for your answer. Realthunder uses the constraint solver from Solvespace for Assembly3. From there comes the idea to use strong features from other systems. How this looks like from a programming point of view I can't say for lack of knowledge. Microelly2 uses in his Nurbs Workbench self programmed tools to create surfaces.
Best regards
Wilfried
User avatar
kkremitzki
Veteran
Posts: 2515
Joined: Thu Mar 03, 2016 9:52 pm
Location: Illinois

Re: BRL-CAD Fillet and Thickness

Post by kkremitzki »

Recently I happened to realize that BRL-CAD was not packaged for Debian/Ubuntu and did some digging on it. It looks like it's been a wishlist item since 2005. I then found that there was packaging work done for it previously but just never uploaded, so packaging it is an easier task, just a matter of updating rather than creating from scratch. So for what it's worth, FreeCAD & BRL-CAD integration in the future may be more viable. And it's a very interesting option, being able to use either OpenCASCADE or BRL-CAD as desired for development.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: BRL-CAD Fillet and Thickness

Post by vocx »

freecad-heini-1 wrote: Mon Dec 30, 2019 8:56 am Thank you for your answer. Realthunder uses the constraint solver from Solvespace for Assembly3. From there comes the idea to use strong features from other systems. ...
Those are not very tightly integrated libraries relatively. Anything that touches something in the Part Workbench, anything that operates on the basic "Part_TopoShape" of objects is going to be difficult to replace by another library.

Also, don't quote my entire post. It makes your reply a pain to read if you aren't addressing a particular point.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
freecad-heini-1
Veteran
Posts: 7790
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: BRL-CAD Fillet and Thickness

Post by freecad-heini-1 »

If you look here:
https://sourceforge.net/projects/brlcad/reviews/
Then you find out that BRL-CAD has no radii, no sweep and loft and probably no Gordon-Surface and freeform surfaces.
ickby
Veteran
Posts: 3116
Joined: Wed Oct 05, 2011 7:36 am

Re: BRL-CAD Fillet and Thickness

Post by ickby »

Brlcad does not use Brep geometry like freecad, they use a CSG representation. So everything is stored as boolen operatiins of shapes, and not as curves and surfaces etc. Imho you can also not create this kind of geometry from the brl cad data, intersections etc. are never calculated. For visualisation they thave a raytracing alririthm that evaluates the CSG tree.

A few years back brlcad developed a Brep data structure as additional representation. I think it was ready, however, i do not know if they ever finished any algorithms for it. That would be a chance if interoperability.
User avatar
Vincent B
Veteran
Posts: 4735
Joined: Sun Apr 05, 2015 9:02 am
Location: La Rochelle, France

Re: BRL-CAD Fillet and Thickness

Post by Vincent B »

As Salome is a Open source program and use OCCT too, have a look how Salome do with fillet?
lukasubo
Posts: 45
Joined: Sun Jun 05, 2016 5:41 pm

Re: BRL-CAD Fillet and Thickness

Post by lukasubo »

GlouGlou wrote: Wed Sep 23, 2020 5:39 pm As Salome is a Open source program and use OCCT too, have a look how Salome do with fillet?
I'd expect the same as FreeCAD, using the OCCT fillet algorithm. Salome is developed by Open Cascade, so I doubt that they would write a better fillet algorithm but never include it in their kernel. Though there are a couple of French government agencies also developing Salome, so I suppose it's possible.
Post Reply