Looking for a challenge? Interesting projects for contributors
This is a collection of issues that might be a fun weekend project (or more) for interested contributors. They are fairly self-contained and don't require much familiarity with VirtualBow, but would have a big impact. I can provide more detailed information and guidance on request.
Clothoid spline curves
The profile curve in VirtualBow is described by segments of various types, among them a cubic spline with user-supplied control points. As described by the links in #265, clothoid splines have many advantages over polynomial splines and might be a good fit for VirtualBow. Unfortunately they also come with their own disadvantages. Therefore the task would be to experiment with Clothoid splines, maybe starting with a Python prototype, and see if they are a viable alternative. The end goal is an interpolation method with the following properties:
- Input: List of control points (x, y) and a starting angle
- Output: Spline curve that is parameterized by arc length and that fits the control points nicely with minimum overall curvature
- The fitting of the spline curve must be fast/efficient enough for interactive editing
Export of the bow geometry
Issue #91 contains some preliminary work in Python for exporting the bow geometry as STEP and STL files for integrating with CAD programs. To push this feature over the finish line, the Python code would have to be ported to Rust and some of the dependencies (i.e. scipy for interpolation) replaced with Rust alternatives.
Parallelization of the simulation
The simulation is currently single-threaded, but there are points where the work could possibly be distributed (see issue #207). It is unclear though if this actually speeds up the simulation. Since the new solver is written in Rust, restructuring the code for parallel execution, even just for testing, is not so easy. On the plus side there are nice libraries like rayon that we could use.
Linear cross section analysis
Linear cross section analyis #264 is an approach for numerically determining the stiffness properties of arbitrarily complex beam cross sections. Other than analytical methods based on laminate theory, linear cross section analysis exactly captures all the various deformation modes of a beam section like warping, shear, torsion and their coupling with each other. The input is a description of the cross section's geometry and material properties, the output is a 6x6 stiffness matrix for all spatial degrees of freedom of the section.
The Julia package GXBeam contains an implementation of linear cross section analysis that we could try to port to Rust. The theory behind it is documented in the references [1] and [2] below. The result could be published as its own crate since it is completely independent from VirtualBow.
Linear cross section analysis would enable us to tackle the task of computing the torsional stiffness and stability of bows (see also #106), which is an important missing piece in VirtualBow's capabilities.
[1] Giavotto et al. - Anisotropic beam theory and applications
[2] BECAS User Guide
I was very pleased to discover VirtualBow. I compared the results I got from a bow I designed in FreeCAD + its non-linear geometric solver. Great tool you gave there to the community. I then went on GitHub to discover it was in C++ / Qt / Eigen. I was delighted! Then I went on to look for places to contribute and discovered you were porting it to Rust. I would have liked to contribute on some of the UI / CI and delivery / and HPC side of things. Are you down to port it to Rust?
Your Paint.NET clone looks very cool! I know how much work goes into such projects.
But yes, the port to Rust is final I'm afraid. At least for the "solver", i.e. the computational part. I'm almost finished with that, so the next release of VirtualBow will have a Rust solver. The GUI is a different story though, it will probably still remain in C++/Qt for a while. That's because none of the Rust GUI libraries are mature and complete enough yet for the task. But in the long term I would like to port that too when it becomes viable. I hope that doesn't drive you away completely :sweat_smile:
I compared the results I got from a bow I designed in FreeCAD + its non-linear geometric solver.
I'm very curious about how VirtualBow compares to your FreeCAD model. Do you have any results to share?
I reproduced the geometry of the default case of VirtualBow with E=12GPA.
204 N loaded at 63.3° on the tip of the bow
I used a poison ratio of 0.35
103.17 MPa for VirtualBow 121.2 MPa with CalculiX
Interesting, thanks for making this comparison! Seems like the limb in VirtualBow is too stiff since the CalculiX one bends more under the same load. This is consistent with some user feedback I got that the current version of VirtualBow tends to overpredict the draw weight of a bow.
I have simulated the same bow with the new solver, where this is supposed to be fixed. Here are the results if you want to try them:
- String force: 186.3 N
- Angle between string and arrow: 63.0°
- Minimum stress: -107.4 MPa
- Maximum stress: 106.6 MPa
Edit: take user feedback with a grain of salt, they maybe surpassed the elastic modulus and that's why they get less of a draw weight
I did an isotropic material simulation, not taking into consideration shear modulus. It can make the result too stiff, apparently. I want to try to compare real data of wood and the deflection vs strain to check.
With an isotropic material E = 8.435 GPa, I get 5.4mm deflection with the same setup as they do with 2041 N. Maybe the missing 1.1mm is from the indentation in the wood in the real world that I don't get in simulation.
I did an isotropic material simulation, not taking into consideration shear modulus. It can make the result too stiff, apparently. I want to try to compare real data of wood and the deflection vs strain to check.
That's right, neglecting the shear deformation will make a beam more stiff. The effect should be small in long and slender beams (like a bow limb) and more noticeable in short, thick ones. I don't know how CalculiX works, but the presence of a poisson ratio usually also implies that there is shear deformation, since the shear modulus depends on the young's modulus and the poisson ratio by G = 0.5*E/(1 + v).
With an isotropic material E = 8.435 GPa, I get 5.4mm deflection with the same setup as they do with 2041 N. Maybe the missing 1.1mm is from the indentation in the wood in the real world that I don't get in simulation.
Another reason might be the material nonlinearity in the real test. If I understand correctly, the force of 2041N and deflection of 6.5mm is where the sample fails. According to the graphs on the bottom right (force vs. displacement graphs) the relationship between force and displacement is only linear up to around 2-3mm of deflection. This is the range where the young's modulus of E = 8.435 GPa is valid. After that the graphs begin to curve downwards until failure, so the displacements get larger than a linear material law would predict.