Topological Naming (another take)

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

freecad-heini-1 wrote: Sat May 05, 2018 11:44 am Please can you check if your topo naming improvement care about the faces if I change the order from thickness after or before a pocket:
My toponaming branch currently can only handle the following feaures:
  • Box
  • Cylinder
  • Fusion
  • Cut
  • Fillet
I'm not familiar with this "thickness" function in FreeCAD, but I bet it utilizes classes that I haven't touched yet.

I'm still trying to get this AppImage thing figured out, so maybe when it's done you can try it yourself :-P
freecad-heini-1
Veteran
Posts: 7791
Joined: Tue Jan 07, 2014 11:10 am
Contact:

Re: Topological Naming (another take)

Post by freecad-heini-1 »

Any news concerning topo naming and your appimage?
Please let me know.
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

So, after some time away, I've had a chance to came back to this. I'm currently working on packaging the showcase that I displayed in my first post in this thread for distribution in ubuntu. I believe that this will be the "easiest" way to create an appimage for easy distribution and sharing.

As it stands, I've had some success! I have created a ppa for my OccWrapper library that I mention in the first post. Unfortunately for most, this does not really help you much unless you wish to compile a program using this library.

For those that may want to explore, the tests show the basic usage of the library. This standalone program also shows off some of the features that the OccWrapper library provides. After adding the ppa I linked above, you should be able to compile the SimpleTest.cpp with:

Code: Select all

# you only need this the first time you compile
sudo apt install occwrapper-dev
#this creates SimpleTest.o
gcc -I/usr/include/OccWrapper -I/usr/include/occt  -std=c++11 -Werror -Wextra -Wall -Wno-maybe-uninitialized -o SimpleTest.o -c SimpleTest.cpp
# this creates the executable SimpleTest
g++ SimpleTest.o -o SimpleTest -L/usr/lib/OccWrapper  -L/usr/lib/occt -rdynamic -lTKFillet -lTKernel -lTKG2d -lTKG3d -lTKMath -lTKShHealing -lTKBool  -lTKBO -lTKBRep -lTKTopAlgo -lTKGeomAlgo -lTKGeomBase -lTKPrim -lTKFeat -lTKCAF -lTKLCAF -lOccWrapper -Wl,-rpath,/usr/lib/OccWrapper:/usr/include/occt
You should then be able to run the "SimpleTest" executable, which will print a few lines of output and create a brep file that you can open in FreeCAD.

I can share more for those interested. For now my wife is calling me to bed!
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

I've uploaded some doxygen documentation for the OccWrapper library.
ezzieyguywuf
Posts: 656
Joined: Tue May 19, 2015 1:11 am

Re: Topological Naming (another take)

Post by ezzieyguywuf »

I've added the python c modules to the ppa packages. Now, if you add my ppa, you can do:

Code: Select all

sudo apt install python-occwrapper
python
>>> import OccWrapper as oc
>>> box = oc.makeBox(10, 10, 10)
>>> cyl = oc.makeCylinder(2.5, 10)
>>> fused = box.fuse(cyl)
>>> fused.writeFile("fused.brep")
This will create a file "fused.brep", which can be imported into FreeCAD for inspection.

If it seems like this OccWrapper library is duplicating some of the work alread done in FreeCAD, that's because it is. I created OccWrapper because I wanted to more easily be able to access functionality from OpenCasCade without having to pull in the entire FreeCAD build tree just to get access to TopoShape. With OccWrapper, I can more quickly (attempt to) develop a library for solving the topological naming issue.

Anyway, for now it mostly just does what I've shown above: it doesn't wrap the entire OpenCasCade library yet - I thought it best to start small and see how it went. Aside from the basic functionality of building a Box or Cylinder and allowing you to fuse them together, it also provides the handy ModifiedSolid class.

The OccModified class is a "helper class" (as I call it) which is used to store and move around the information needed to keep track of the topological changes in a solid. It is a critical component in the topological naming library I'm writing.
triplus
Veteran
Posts: 9471
Joined: Mon Dec 12, 2011 4:45 pm

Re: Topological Naming (another take)

Post by triplus »

ATM i don't have much time for testing. But i could imagine in FreeCAD 0.19 (potentially 0.20) development cycle TopoNaming solution(s) will be at play.
Post Reply