Script or something like it to make a slot
 1-20  21-31

Next
 From:  fcwilt
9876.1 
Hi,

I know I can use two circles and two lines with the boolean command to create an outline of a slot for later use in creating slots in a solid.

But I do this quite often and I was wondering if there was a way to make this as easy as just creating a circle.

Thanks.

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Cemortan_Tudor
9876.2 
rectangle round corners ?
- Tudor -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
9876.3 In reply to 9876.2 
Hi,

Thanks for the feedback.

I never noticed that option before.

That does simply things a bit.

Consider the way I have been doing it with the two circles and two straight lines - the "length" of the slot is the distance between the centers of the two circles.

In my ideal "tool" all I would need to enter would be the radius and that distance.

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.4 In reply to 9876.3 
Hi Frederick,

re:
> In my ideal "tool" all I would need to enter would be the radius and that distance.

If you can make an example object result with a given radius and distance that would help.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
9876.5 In reply to 9876.4 
Hi,

I use 3mm as the radius for M5 holes.

Let's say I want to create a slot for a M5 machine screw so the piece with the slot can be adjusted one M5 diameter.

Currently to create the slot outline I do the following:

Step 1 - draw a line 6 mm line (one M5 diameter)

Step 2 - draw a circle with R=3 (M5 radius) at each end of the line

Step 3 - draw lines connecting the two circles (quad to tangent) at the top and bottom of the circles

Step 4 - use the boolean union operation on the two circles and the two lines creating the slot outline (after cleanup)


Now I can place the slot outline on a solid at the desired locations and use the boolean difference operation to create slots in the solid.


So the operation I envision would allow me to specify just the R=3 and the 6mm slot length yielding the finished slot outline.

Frederick

EDITED: 26 Mar by FCWILT

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.6 In reply to 9876.5 
Hi Frederick, where should the curve be positioned? Do you want to specify only radius and length and have it created at 0,0,0 ?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
9876.7 In reply to 9876.6 
Hi,

Well I'm feeling more than a little foolish now.

I just found out that when using the "Rounded Corners" option on Rectangles the Radius value I seek can be obtained from the current Height value just by moving the mouse pointer a bit to the inside of the rectangle.

Here you have already provided the solution and I never once happened to move the mouse pointer as needed.


I've said it before and I will say it again, MOI is brilliant.

Sorry for wasting your time.

Frederick

EDITED: 10 Jul 2020 by FCWILT

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.8 In reply to 9876.7 
Hi Frederick, no problem I'm glad you have a method to do it!

I had an idea that maybe drawing a center line as the definition for the slot might be useful.

Here's a script that does it that way:



To give a specific length, set a distance constraint using the "d" field in the bottom command bar.

- Michael

EDIT: updated command to have radius/diameter toggle and to use diameter as default if set in moi.ini .

EDITED: 13 Jul 2020 by MICHAEL GIBSON

Attachments:

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Cemortan_Tudor
9876.9 
what's setHitTest
- Tudor -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.10 In reply to 9876.9 
Hi Tudor,

re:
> what's setHitTest

It turns hit testing on or off - hit testing is when an object is targeted for click selection or snapping. In some cases when a script is dynamically creating an object on every mouse move, that object can leave behind things like intersection snaps. Hit testing can be turned off in such cases so the object will be ignored for generating snap points.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
9876.11 In reply to 9876.8 
Hi,

Well that is even better than I envisioned as you have provided for putting the slot on an angle.

And you were able to provide this feature with the two zipped files? How cool is that!

I placed the files in the "command" folder of MOI and was able to invoke the command via the XYZ entry field (or whatever it is called).

Slick.

I know I can add a shortcut key to invoke it but, just out of curiosity, is there a way to add new commands like this to the side pane?

Thanks very much.

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  nameless
9876.12 
"rectangle round corners ?"

Haha, after all these years it's the first time I notice that option. I was filleting corners like there is no tomorrow!
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.13 In reply to 9876.11 
Hi Frederick,

re:
> I know I can add a shortcut key to invoke it but, just out of curiosity, is there a way
> to add new commands like this to the side pane?

It is possible by editing the HTML files that make the side pane. Where exactly do you want to add it?

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Cemortan_Tudor
9876.14 
I think maximize viewport option *)) without any panel or sides ones
- Tudor -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.15 In reply to 9876.14 
Hi Tudor,

re:
> I think maximize viewport option *)) without any panel or sides ones

Try this:
http://kyticka.webzdarma.cz/3d/moi/#MaximizeViewport

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Cemortan_Tudor
9876.16 
by side panel I understand as object browser panel or commandUi panel
- Tudor -
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
9876.17 In reply to 9876.13 
Hi,

Well it would seem to belong there with the Circle command Yes? No?

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.18 In reply to 9876.16 
Hi Tudor,

re:
> by side panel I understand as object browser panel or commandUi panel

If you set up the script mentioned above (http://kyticka.webzdarma.cz/3d/moi/#MaximizeViewport)
on a shortcut key, then it would be possible to maximize and unmaximize viewports without using
any other UI.

If you mean you want some way to hide all the regular UI panels, try this one:
http://kyticka.webzdarma.cz/3d/moi/#FullScreen

If neither of those is correct I will need more details about what you're trying to do.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  Michael Gibson
9876.19 In reply to 9876.17 
Hi Frederick, so the little clusters of related commands like the circles is called a "command set".

There are 2 files that make up a command set, one is a .htm file for the UI and the other is an .xml file that lists the commands in it.

For the circles these are the files Circles.htm and Circles.xml which you can find in the commands folder inside MoI's install folder.

Edit the Circles.xml file by adding in an entry for "slot", like this:

<commandset>
   <command>circle</command>
   <command>circlediameter</command>
   <command>circle3pt</command>
   <command>circletangent</command>
   <command>slot</command>
</commandset>

Edit the Circles.htm file by by putting in a command button like this:

<html>
   <body class="CommandSetBody">
      <moi:CommandButton icon="moi://ui/icons/CircleCenterIcon.png" command="circle"><moi:Text textid="CircleCenter"></moi:CommandButton>
      <moi:SmallSpacer />
      <moi:CommandButton icon="moi://ui/icons/CircleDiameterIcon.png" command="circlediameter"><moi:Text textid="CircleDiameter"></moi:CommandButton>
      <moi:SmallSpacer />
      <moi:CommandButton icon="moi://ui/icons/Circle3ptIcon.png" command="circle3pt"><moi:Text textid="Circle3pt"></moi:CommandButton>
      <moi:SmallSpacer />
      <moi:CommandButton icon="moi://ui/icons/CircleTangentIcon.png" command="circletangent"><moi:Text textid="CircleTangent"></moi:CommandButton>

      <moi:SmallSpacer />
      <moi:CommandButton icon="moi://ui/icons/SlotIcon.png" command="slot">Slot</moi:CommandButton>

   </body>
</html>

Then the last thing is to create a bitmap image for button, that should be a 64x64 pixel sized PNG file named SlotIcon.png which goes in the /ui/icons directory.


With that set up you should then have a 5th entry for "Slot" added into the Draw curve > Circles command set.

You will need to repeat this process with installs for new versions.

- Michael

EDITED: 11 Jul 2020 by MICHAEL GIBSON

  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
Next
 From:  fcwilt
9876.20 In reply to 9876.19 
Hi Michael,

I truly appreciate your help and guidance.

You've created an amazing program and your willingness to help add to it's functionality is even more amazing.

Frederick
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
Show messages:  1-20  21-31