MarcelP102 Posted June 24, 2022 Share Posted June 24, 2022 Hi, A lot of times when working in 3D I want to use the Working Plane but my view got blocked by objects in front of the plane. The Clip Cube can help with that. But it takes a lot of time to setup. That's why I decided to make a script that sets the Clip Cube based on the active Working Plane. Since there are no functions available to set the position of the Clip Cube I used a trick to make a huge extrusion on the workplane and use that to set the boundaries of the Clip Cube. This works for most user-cases but unfortunately not for rotated Working Planes. @Marissa Farrellcan you throw in an enhancement request for more control of the Clip Cube with Vectorscript? Step 1: Set Working Plane Step 2: Look at Working Plane, view gets blocked Step 3: Run Script, view gets unblocked PROCEDURE ClipCubeByPlane; {Sets the Clip Cube position equal to the Working Plane.} {Since we cannot rotate the Clip Cube by script this work best with Working Planes on X and Y.} {© 24-06-2022 Arnhem - The Netherlands, Marcel Plomp} {Licensed under the GNU Lesser General Public License} VAR H1 :Handle; xRot, yRot, zRot :REAL; p0X, p0Y, p0Z :REAL; BEGIN {Turn off Clip Cube} SetPref(6707, FALSE); DSelectAll; {Create big extrusion} BeginXtrd(0,-1000000); rect(-1000000, 1000000, 1000000,-1000000); EndXtrd; {Get workplane coordinates} GetWorkingPlane(p0X, p0Y, p0Z, xRot, yRot, zRot); {Move object to workplane} H1:=LNewObj; SET3DRot(H1, xRot, yRot, 0 , 0,0,0); Move3DObj(H1, p0X, p0Y, p0Z); {Enable Clip Cube and delete object} SetPref(6707, TRUE); DelObject(H1); END; RUN(ClipCubeByPlane); 2 Quote Link to comment
Tom W. Posted June 24, 2022 Share Posted June 24, 2022 This would be very useful! Or somehow to make a Clip Cube automatically align/rotate to a selected object on creation (I am forever activating the Clip Cube, rotating it to align with the model then creating a Saved View). As a secondary point, @MarcelP102 you are making scripting look really easy it is very inspiring well done! 1 Quote Link to comment
mattao Posted January 9 Share Posted January 9 Indeed it would be very pleasant to have clip cube oriented to some specific working plane or object Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.