Closed LeonB closed 2 years ago
Hi, Leon, nice dog ;-)
If you use non-rectagle shape you have options:
Feel free to reopen this issue if this not solved your problem.
Thanks Darek
Thanks! I've opted to get the outside dimensions of the sketch via the get_sketch_dims function I copied from https://wiki.freecadweb.org/Macro_Shake_Sketch. Now it does what I want!
So, the code is not so hard if you were able to change it ;-) I make comments because in my opinion the open source code should be clear and well-documented, not spaghetti code.
Regarding the problem, it is depending from user's choice so it can't be calculated automatically correctly. Sketch allows you to draw anything, and you never know what constraints are the interesting ones, what shape it is, unless user mark the exact dimensions somehow. Also you have wrong m2 calculation because to calculate different shape than rectangle you need to know what shape it is and if this would involve curve you need to calculate it using integrals or even more advance mathematics. This is not for it ;-)
In my opinion it would be better to use c - report type because you can describe any shape like this. But if you are happy with this solution, why not.
I supports what I need from it at the moment: a spreadsheet I can export to custlistoptimizer. Thanks for your hard work!
I have already added new approximation report a - report type. This report calculate vertex in raw form but it has exactly the same columns order so it can be imported directly at this page ;-) Thanks for the info about this page, nice tool.
@dprojects this is awesome! Works perfectly for my needs.
Shouldn't the thickness (now in column label) be in the column material? And then the name (like in the n report) be in the label column?
n - report is special type of report but it is list of objects, the quantity there is always 1, so label of the object make sense. If you have items grouped by quantity, more than one, there can't be label of the single object, there should be some kind of group name, thickness can be. There is also g - report type with folder name.
Thickness in material column make sense to me. But the label would be empty then. I was thinking to add auto-edgeband but there is little problem with that. At normal cube you have 6 faces, for array there can be more faces. But at the report you have only 4 columns for edgeband. And even If you assign 1,2,3,4 faces from Cube you can't be sure this will be correct. Also you never know which one should be left or right.
About material column I was thinking more like type of wood, text not value, or color, oak, white or plywood. There are many options, depends what someone use. In fact at the custlistoptimizer the thickness is not used at all, because it is 2D optimizer.
It would be nice to fill automatically all the columns but this is little problematic as you see.
Thanks! Clear. It's very usable as it is now. So no sweat keeping it as it is. I wouldn't mind if the qty is always 1 in that report and a label could get added.
The material column, in cutlistoptimizer at least, is for distinguishing the cuts for different sheets. So poplar ply 12mm vs poplar ply 18mm for example. But also white laminated 18mm vs black laminated 18mm for example.
So maybe in this case the thickness should be at label and also at material? the object label is important for you? maybe at label it would be better to place group name? similar to this https://github.com/dprojects/getDimensions/tree/master/Docs#wood-properties---grain-type-color-etc so you would be able to add "18 mm, plywood, white" or something like that. Is there any custlistoptimizer documentation? what they say about those columns? how they describe the label and material column? are there any examples?
@dprojects group name sounds like a nice solution!
No documentation about cutlistoptimizer as I can see.
Label is only used for labeling the pieces in the diagram.
You have Qty = 1 everywhere so this make sense. What if the Qty is != 1 ? there should be some kind of group name. The "18 mm, white" could be but in fact the next spreadsheet "Stock sheets" should have named sheets and if you have for example 2 sheets of "18 mm, white" and 1 sheet with "18 mm, black" and you want to cut 4 pieces with label "18 mm, brown" this should not be allowed. But the label, material columns are probably some kind of notes for user and they are not involved in calculation? the material column is checked somehow? if you want to cut Material 2 but you have only Material 1 this will be still allowed?
Little improved. Material is thickness. Label is from group name. And grain direction also from group name. So missing part is only edgeband, maybe someday, because I have to recognize "exact size" and "edge type". https://github.com/dprojects/getDimensions/tree/master/Docs#a---report-type
@dprojects I'm getting an error at the moment:
21:47:28 Traceback (most recent call last):
File "/Users/leon/Library/Preferences/FreeCAD/Macro/getDimensions.py", line 3960, in <module>
selectView("main")
File "/Users/leon/Library/Preferences/FreeCAD/Macro/getDimensions.py", line 3861, in selectView
setViewA(iCaller)
File "/Users/leon/Library/Preferences/FreeCAD/Macro/getDimensions.py", line 2596, in setViewA
g = more[1]
<class 'IndexError'>: list index out of range
If I create a new document with a standard cube and execute the getDimensions macro, report A, I get this error:
Well yes ;-) I forgot that someone may not want to use the group and comma syntax ;-) this should be in try block ;-) if you remove the fakeCube and put the Cube in any Group with name that contains comma this will be OK. I will fix it, soon.
@dprojects thanks again!
Thanks for the great project!
I tried it with a little organizer I'm designing. But the sides have a non-rectangular shape:
The macro then doesn't calculate the outside dimensions correctly:
It picks the dimensions of the first (smallest) rectangle. Not the outside dimensions what I would need to cut from my sheet.
I've attached the part as seen in the screenshot:
freecad-getdimensions-test.FCStd.zip
I've looked at the python script but I was a little bit too large to quickly find where the issue was.