pack3d icon indicating copy to clipboard operation
pack3d copied to clipboard

Is there any way to lock the orientation of certain parts?

Open BrianGilbert opened this issue 7 years ago • 10 comments

this a cool program.. just wondering if there is any way to lock orientation of certain parts?

BrianGilbert avatar Jan 29 '18 19:01 BrianGilbert

Not currently, although it wouldn't be terribly difficult to do.

fogleman avatar Jan 29 '18 19:01 fogleman

Anywhere I can possibly talk to you realtime? Sending you a tweet..

BrianGilbert avatar Jan 29 '18 20:01 BrianGilbert

Are you able to point me ion the right direction? It'll likely be over my head.. but willing to try..

BrianGilbert avatar Jan 29 '18 20:01 BrianGilbert

@fogleman I'm thinking about how this could be acheived.. would you do it by using strings in the filename of the STL?

BrianGilbert avatar Jan 29 '18 23:01 BrianGilbert

@fogleman any availability to put me on the right path with this?

BrianGilbert avatar Jan 31 '18 02:01 BrianGilbert

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 avatar Jan 31 '18 02:01 fogleman

@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?

BrianGilbert avatar Jan 31 '18 02:01 BrianGilbert

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 avatar Jan 31 '18 02:01 fogleman

@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?

BrianGilbert avatar Jan 31 '18 06:01 BrianGilbert

@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?

BrianGilbert avatar Feb 01 '18 05:02 BrianGilbert