pack3d
pack3d copied to clipboard
Is there any way to lock the orientation of certain parts?
this a cool program.. just wondering if there is any way to lock orientation of certain parts?
Not currently, although it wouldn't be terribly difficult to do.
Anywhere I can possibly talk to you realtime? Sending you a tweet..
Are you able to point me ion the right direction? It'll likely be over my head.. but willing to try..
@fogleman I'm thinking about how this could be acheived.. would you do it by using strings in the filename of the STL?
@fogleman any availability to put me on the right path with this?
https://github.com/fogleman/pack3d/blob/master/cmd/binpack/main.go#L75
If you filter out these rotations for the model that you want to lock, and only use the identity matrix, it should work.
@fogleman I have to admit I can't grok where it's looping over the files so that I can skip the rotations for the desired ones?
The loop right outside that one is looping over filenames passed in on the command line.
https://github.com/fogleman/pack3d/blob/master/cmd/binpack/main.go#L58
@fogleman I've made some progress, but I also realised that I don't want to lock the orientation in all axis, I think I just want to stop rotation in X&Y axis, but am hapy for the part to be rotated on Z axis and moved in X&Y..
Is the code at https://github.com/fogleman/pack3d/blob/2c30ae96c6b2f6efd44c17c58e8dcb4bc81b6c9e/cmd/binpack/main.go#L75-L82 entirely responsible for the rotations? (Actually I think it's the init function maybe)
I don't really understand where the rotation is taking place, are you able to help please?
So essentially my approach is to have a string in the filename that would trigger a condition to stop X&Y rotations of the part (I have a check for the filename working now with a true/false response), but I'm not sure where to put the condition to disable X&Y rotations.
Can I just put an if statement on this check around https://github.com/fogleman/pack3d/blob/2c30ae96c6b2f6efd44c17c58e8dcb4bc81b6c9e/cmd/binpack/main.go#L78-L79 and provide different math if I get a hit on my condition? (No I think this is just adding the spacing to parts maybe) If so could you please help me with what the locking math should be?
@fogleman I expect I may need to create an alternate Rotations array that only does rotations in the desired axis and use it when my condition is true.. any chance you might find some time to assist?