Primitive geometry and mesh generation in C++

Hello All
What I trying to do is , generating some primitive 2d shapes and show in the gui with dimensions which is important. Then I would like to generate 2d mesh from the geometry and do some calculations with the variables inside the mesh. (e.g. temperature difference of a 2d ogive geometry)

Is there any tool or API to do this in C++?
Thanks
Doing heat equations is a very different thing than making shapes, so it's best to separate out those two pieces of logic.
Perhaps I'm way off base with what you mean by "temperature difference", but for numerically calculating heat equations, you'll most likely need some sort of differential equation/matrix solving. One basic way of solving heat distribution through a 2d shape is to have boundary conditions and then assume that each grid is the average temperature of the 4 surrounding grids. If you can form your equation into a band matrix then it can be solved easier.
https://en.wikipedia.org/wiki/Band_matrix

I have heard good things about the Eigen linear algebra library, although have not used it, so I won't actually recommend it. It has a BandMatrix class that I'm sure is designed to be efficient with this sort of problem.

As far as actually making primitive 2D shapes on a screen, the usual recommendations (esp. for beginnings, if you are one) is SFML or SDL.
https://www.sfml-dev.org/
Last edited on
thanks. I actually need to divide the created geomerty into the meshes. It is similar to FEM or FEA but I could not reach the sfml website.İt is broken. Should I look through open FEM packages ?
Oh, I see. I'm not sure of a suite of programming tools for FEM. But here's a bump so maybe some other engineer might know.

Yeah I would say do a search for FEM packages if no one else here knows.
https://en.wikipedia.org/wiki/List_of_finite_element_software_packages
Last edited on
Topic archived. No new replies allowed.