CAD_Sketcher icon indicating copy to clipboard operation
CAD_Sketcher copied to clipboard

Add operator to align a workplane to the 3d cursor

Open hlorus opened this issue 2 years ago • 6 comments

Aligns selected workplane to the 3d cursor. Maybe it should somehow be possible to set the cursor while being in the solvespace select tool.

hlorus avatar Aug 19 '22 11:08 hlorus

Okay so I'm going to spell out a path to accomplish this issue. I welcome any edits or suggestions to this path.

  1. obtain the 6-vector coordinates from the 3d cursor that is the position and location of the 3d cursor plane. The official blender documentation on this can be found here.
Screen Shot 2022-09-01 at 1 10 17 AM
  1. make the selected workplace in the CAD_sketcher section of blender rotatable by taking input from the shift+D pad and updating the angled values of the current work plane. Like say the angles of the work plane (in degrees) are (0,0,90), this could be altered by 5 degrees by pressing shift+Up_d_pad resulting in (0,0,95) for the degrees of the work plane.

  2. make another user input clickable button or hotkey such as shift+U for instead of altering the work plane angles incrementally where they were before, instead throwing out these angles and using new angles that are grabbed from the angle and position data from where the 3d cursor is. I guess this brings up some clarification, @hlorus, did you mean to say align just the angle of the selected workplane to the 3d cursor, or also the position of the workplane to the 3d cursor, as a generalized reference geometry plane would be added in solid works, as is shown in the solid works documentation here and there is a video of on YouTube here?

therealjacobbrauer avatar Sep 01 '22 08:09 therealjacobbrauer

Are you suggesting that the user copies the values from the panel and paste it somewhere?

IMO that would be a rather slow workflow. The idea here is to create a operator which does this in one step.

hlorus avatar Sep 01 '22 08:09 hlorus

Note that CS currently doesn't have a concept of an active entity. Therefore i'd suggest to display this operator in the context menu of workplanes.

hlorus avatar Sep 01 '22 08:09 hlorus

Are you suggesting that the user copies the values from the panel and paste it somewhere?

IMO that would be a rather slow workflow. The idea here is to create a operator which does this in one step.

No I wasn't suggesting that the user copies the values from the panel and paste it somewhere, it was more of pseudocode to have a developer write a function that grabs the values when the user selects the operator "align workplane with 3d cursor". My apologies about not being clear on my reply.

therealjacobbrauer avatar Sep 01 '22 09:09 therealjacobbrauer

Note that CS currently doesn't have a concept of an active entity. Therefore i'd suggest to display this operator in the context menu of workplanes.

what in my spelled out path to accomplish finishing this issue prompted you to think that I was asking for BCS (blender_cad sketcher) to have a concept of an active entity? I am not familiar with the term active entity and I am willing to edit it out of my proposed solution I just don't understand which part of my proposed solution you are specifically referring to.

thanks for getting back to my replys so quickly!!

therealjacobbrauer avatar Sep 01 '22 09:09 therealjacobbrauer

Note that CS currently doesn't have a concept of an active entity. Therefore i'd suggest to display this operator in the context menu of workplanes.

what in my spelled out path to accomplish finishing this issue prompted you to think that I was asking for BCS (blender_cad sketcher) to have a concept of an active entity? I am not familiar with the term active entity and I am willing to edit it out of my proposed solution I just don't understand which part of my proposed solution you are specifically referring to.

thanks for getting back to my replys so quickly!!

That was just a general note. Blender has the concept of an active object. As that's not available in BCS the operator will need to have a property to specify which workplan it should act on. "slvs_entity_pointer" can be used to achieve that.

Regarding your described approach: Not sure what's ment by "shift+D pad". Also incrementally rotating workplanes seems a bit out of the scope here.

did you mean to say align just the angle of the selected workplane to the 3d cursor, or also the position of the workplane to the 3d cursor...?

I'd say both but would be great to have a setting to just apply the location or rotation.

hlorus avatar Sep 01 '22 10:09 hlorus