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?
BRL-CAD Fillet and Thickness
Forum rules
Be nice to others! Read the FreeCAD code of conduct!
Be nice to others! Read the FreeCAD code of conduct!
-
- Veteran
- Posts: 7790
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: BRL-CAD Fillet and Thickness
I think Yorik is in contact with guys from BRL-CAD.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?
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.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
-
- Veteran
- Posts: 7790
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: BRL-CAD Fillet and Thickness
Hello vocx,vocx wrote: ↑Mon Dec 30, 2019 12:15 amI think Yorik is in contact with guys from BRL-CAD.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?
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; }
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
- kkremitzki
- Veteran
- Posts: 2515
- Joined: Thu Mar 03, 2016 9:52 pm
- Location: Illinois
Re: BRL-CAD Fillet and Thickness
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.
Re: BRL-CAD Fillet and Thickness
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.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. ...
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.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
-
- Veteran
- Posts: 7790
- Joined: Tue Jan 07, 2014 11:10 am
- Contact:
Re: BRL-CAD Fillet and Thickness
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.
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.
Re: BRL-CAD Fillet and Thickness
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.
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.
Re: BRL-CAD Fillet and Thickness
As Salome is a Open source program and use OCCT too, have a look how Salome do with fillet?
Re: BRL-CAD Fillet and Thickness
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.