-
Notifications
You must be signed in to change notification settings - Fork 4
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
Automatically resize grid according to the model size #12
Comments
I'd like to try my hand at this! |
Great! 😊 |
Perhaps it would also be nice to have the option to not include the grid at all |
@shimwell Yeah! 👍 |
Does this approach sound ok to you @Peque ? make another variable called then add an if statement to the |
@shimwell So I guess you are suggesting that, by default, no grid should be displayed (unless the user defines I think I would rather leave the default behavior as-is (i.e.: show a grid). So, how could we disable the grid? Instead of adding a new parameter, I'd say |
That sounds better |
Changing this to this appears to work for me if ( gsize > 0 ){
var grid = new TranslucentGrid( gsize, gdivs, 0x888888, 0xdddddd, 0.6, );
} |
@shimwell What about the references to Maybe put all those lines inside the |
Yep you are right. I was just testing it worked with out the grid I can make a PR for your consideration |
Just to get this issue back on track I wanted to mention that Cadquery has a bounding box that can be used to find the shape size in x,y,z https://cadquery.readthedocs.io/en/latest/classreference.html?highlight=boundingbox#cadquery.Shape.BoundingBox |
Right now the grid is defined with its size and number of divisions.
While this is fine and should be kept as a possibility, the default should set a grid with a size double the longest dimension of the displayed model.
The text was updated successfully, but these errors were encountered: