-
Notifications
You must be signed in to change notification settings - Fork 537
Implement basic mirror groups. #1109
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
base: master
Are you sure you want to change the base?
Conversation
|
@ruevs and @jwesthues Looking for feedback on this so far. It's got one and two sided, but one-sided make the original go away which doesn't seem right. I think the original solid should remain, but any idea why the solid created in a previous group goes away when its mirrored? Also wondering about where in the code to add optional constraint when the group is created. For example, any points selected should be constrained coincident with the (invisible) mirror plane. Or a face selected should be used to fully constrain the mirror plane. It looks like those constraints should be created in Group::GenerateEquations() but the selection stuff is available in Group::MenuGroup() which creates the group. What to do here? |
|
If you step and repeat group x, then the step and repeat starts with the same solid model as group x would have started with. This means that if the step and repeat doesn't include the original (e.g., because it starts with copy number one, or because it's two-sided with an even number of copies), then the original disappears. Your current behavior seems consistent with that. I think there'd also generally be no difference between your one-sided and two-sided options if the original were always present? For the constraints, perhaps best to create them in the same way as user-created constraints using |
|
Perhaps I will have time to take a look over the weekend. |
|
@jwesthues I don't understand how the previous groups shell is removed when I do one-sided mirror, or how it can happen for repeat groups. What I was hoping is that one-sided would leave the original and create a single mirrored copy, just like the entities. I thought two sided would be tricky because I'd want to remove the previous groups shell and include it in the 2-sided group shell, but that seems to be how it's working already. I just don't want the old shell to go away for one-sided. Also, I'm not sure why mirroring a 2d sketch results in something that won't create a shell when extruded. |
|
Here's the line that makes the shell/mesh work that way for existing step and repeat groups: Lines 232 to 234 in bb19389
Without that it would be very hard e.g. to extrude a shape and then step and repeat the extrusion four times symmetrically about the original, since there'd be no good way to get rid of the original extrusion. (Of course the original entities still exist, since nothing in a subsequent group can affect them in any way; this is only about the solid model. So this is relevant only if e.g. we extrude and then step, and not if we step and then extrude. But sometimes it's necessary to extrude and then step, for example if the steps don't all lie in the original sketch plane. I believe a similar issue exists with mirror.) Re the failure to extrude, are you sure that you're ending up with a closed planar section? Enabling the same |
|
@jwesthues OK, the current equivalent code for Mirror looks like this: This makes the original disappear for a one-sided mirror group, which I don't want. What I want is that when a solid (say g003) gets mirrored into g004 you'll always see 2 objects. For 2 sided a subsequent mirror group (g005) would have 4 objects. If g004 is one-sided it will still have two objects but a subsequent mirror group will only have 3 objects. The entites currently follow this logic. So I think for 2-sided mirror groups we need to make sure the solid from the previous group (original) is not combined with the overlapping copy in the mirror group (suppress it?). But for 1-sided mirror groups, both the previous group and the mirror group should have a single copy. This should also apply to repeated mirror groups. I'm still unclear on how these shells are combined and in what order, so the logic to do this is also unclear. I also searched for the suppress flag and only see it being set in the text window (checkbox), so it's not clear how it's affecting translate or rotate groups at all. I'm very confused. |
|
If you make Shells (and meshes) are combined with Booleans strictly in group order, in the same order in which they appear in the text window. Normally the Boolean (A union B, A minus B, etc.) takes the output of the previous group's Boolean as input A. Step translate and rotate are handled differently for the reasons noted in my earlier comment here. This happens when the different choice of Line 400 in bb19389
Finally, note that the entity behavior and the solid model behavior for the existing step translate and rotate groups lack the consistency that you're trying for with mirror. If I step and repeat translating an extrusion four times symmetrically about the original, then the original solid model disappears (since it's an even number of copies), but the original entities don't. I don't love that; but I tolerated that because it's easy to hide the original group if you don't want those entities, but hard to remove the original solid model. |
This seems to work for both 2d and 3d groups. I'd still like to get more options added for creating the mirror based on selection. It probably also wants an option to not use the parent group as part of the mirrored group.