New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature request: ability to visualize waterline, CoB and CoG #21
Comments
I am coming with something soon! |
As an additional note I think it would be very useful if you could do this with angles of heel too, so for example you can visualize the waterline of a heeled-over sailboat. Especially with modern hull design trends with hard chines and wide beam this is important to see when choosing their placement on the hull. |
Hey Martijn! Check this out: #23 I added a new tool called Sink and trim, which is computing the equilibrium point on top of a load condition. You can show the results in the ship upright position, or using the free-surface as the reference (i.e. the free surface is the z=0 plane). I am merging it right now, so you can test it with the addon manager. Let me know! P.S. Some changes I made might broke some other tools, so if you test all the tools I will really appreciate that |
Thanks for the quick work, I'll take a look! |
github automatically closed the issue... So, as far as I understood you have created the weight selecting the ship itself and executing the tool. Thus you expect your COG is in the COG of your volume, right? Confirm me that so I start debugging it (you may also attach your FreeCAD project if you want) P.S. This might be wrong, since FreeCAD devs have introduced Units all along the code, which is so far breaking this module. I'll be fixing these kind of bugs for a long time :-p |
That is correct. The weight also doesn't have a weight symbol like those in the wiki, instead the weight visualizes as a copy of the hull, but that's mostly a cosmetic annoyance. |
I also have a suspicion that the entered weight in kilogram is treated as a much heavier weight off by a power of 10, like 100 kg is treated as 1000 kg. This needs to be tested further to be confirmed though. Furthermore, after doing a Sink and trim the results also include some text which contains: On the wiki in the second part of the Freecad ship tutorial it says:
I haven't seen this behaviour, I guess the wiki tutorial is here slightly out of date? Retrying the Sink and trim with the weight set at 400 kg and the weight manually moved to the actual lateral COG (X axis) as indicated by FcInfo I get a |
Ok, I will take a look, don't worry!
It sounds like a gravity doing funny things.
Yes, Δ is the displacement, which yes, shall be equal to the weight
Yeah, the wiki is outdated, forget about it for the time being. See #15 |
As a side note, I haven't calculated it by hand so far, but simply looking at it by eye I think the proper natural trim of this simplistic hull shape will be bow-down, considering the lack of buoyancy at the bow and the lack of weight due to the cockpit cutout in the back. I definitely doubt that it will have 0 degrees trim, which is why it makes a nice test case for this feature. |
Well, I am pretty sure this is a problem of lack of documentation rather than a bug... I have downloaded your project, removed the load condition as well as the weight, selected the ship, executed the weight creation tool, set a density of 300 kg/m3, and executed the sink and trim tool: I suspect you created your weight, and then selected and edited it in the data tab, removing the density and setting the mass. Am I right? Another possibility is that you just simply set the quantity in kg instead of kg/m3. Whatever way you did so, you are instructing FreeCAD-Ship to consider a punctual weight, so it will compute the COG as the average of the shape vertices. Actually the user should never manipulate the weights in the data tab. Let me know if you hacked the weight on the data panel or you did that in the input box please |
Yeah, I am investigating the API, but it is not straightforward to handle those "special" FreeCAD input fields. I suppose I am discovering the trick sooner or later.
It will come!
I checked right now with your example and the COG is perfectly computed up to the machine precision. I typed this on the Python console to get the COG:
The result was
The result was Let me know please! |
Indeed I tried to in a few instances, it's not really clear you shouldn't, but I understand your difficulty.
I did both on at least a few occasions trying to figure out how the tool works. I downloaded my own example, opened it in FreeCAD and first thing I did was run your example code, but I get these results:
This can be explained by your remark:
Retrying it your way, by setting a density of 300 kg/m3 indeed gives the same results as you have. Now I just have a simple question; |
No that doesn't work indeed, I already tried that haha. I've got it working I think, a bit tedious, but it looks great! One thing I would like to add though, everytime I immediately change the opacity of the generated free surface to 0, so that it isn't seethrough. This makes the visualization a lot clearer in my opinion. |
Ok! I am making it opaque in the next commit. Feel free to open another issue about the weights creation and the units |
Hey @martijn-heil , as you can see I have changed the way the user may introduce inputs, in such a way different units can be used, but they should be compatible with the expected value. This way, it is not possible to set the weight in kg for volumes anymore. I suppose that is finally fixing this issue! Please, check and feel free to open new issues if you find more errors |
As per title, I think a useful feature for hull design would be the ability to visualize the actual waterline, center of buoyancy and center of gravity of a ship given the weights defined in this workbench.
The text was updated successfully, but these errors were encountered: