CamBam
News:
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
October 15, 2018, 21:57:50 pm


Login with username, password and session length


Pages: [1] 2
  Print  
Author Topic: Plugin to find Z level of a surface at the cursor position  (Read 407 times)
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3607



View Profile
« on: October 06, 2018, 17:48:30 pm »

Please find attached plugin, tested on both CamBam v0.9.8 and CamBam v1.0

Press the lower case 'z' ( and keep it pressed) while moving the mouse over a surface, no need to click any mouse buttons.
Displayed in the bottom message window will be the Z value of a surface point that is directly under the mouse cursor.

Remember you will likely have to 'unblock' it; http://www.cambam.co.uk/forum/index.php?topic=6294.msg50090#msg50090

Edit:

Version 2 attached, speed improvement (I think )

Tested on CamBam 0.9.8 and 1.0

* FindZ_v2.zip (3.93 KB - downloaded 5 times.)
« Last Edit: October 13, 2018, 20:43:41 pm by EddyCurrent » Logged
dwc
CNC Jedi
*****
Offline Offline

Posts: 516



View Profile WWW
« Reply #1 on: October 06, 2018, 19:17:14 pm »

Hi Eddy,
Great idea. I assume it works with stl surfaces, will it for from a step model too?
If it does I would finally see a reason to use the step import.
Thanks,
Don
« Last Edit: October 06, 2018, 19:28:14 pm by dwc » Logged

Bubba
CNC Jedi
*****
Offline Offline

Posts: 2493



View Profile
« Reply #2 on: October 06, 2018, 20:01:44 pm »

Thanks Eddy. I'm sure find use for it.
Logged

My 2ยข
Bob La Londe
CNC Jedi
*****
Offline Offline

Posts: 3365


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #3 on: October 13, 2018, 17:45:23 pm »

I will have to try this one out soon.  It will save me a great deal of time laying out molds since I am often working with cavities generated from organic shapes.  Often in the past I had to go back to the source CAD file and take slices to find thickness/depth.  Hopefully my design computer is fast enough to use it effectively. 
Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
lloydsp
CNC Jedi
*****
Online Online

Posts: 7626



View Profile
« Reply #4 on: October 13, 2018, 19:29:54 pm »

Eddy,
I installed the unzipped .dll in my 9.8 plugins folder, and unblocked it.

I get nothing, and don't remember how to tell what plugins are actually active in a session.

FWIW, I'm running 9.8 under XP-pro.

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3607



View Profile
« Reply #5 on: October 13, 2018, 20:33:22 pm »

Please find attached to the first post, version 2, it's optimised as far as I can.
You may find it faster if 'snap to object' is OFF

Don,

Yes it works on STL surfaces but It does not appear to work on STEP files.
I'm using an internal CamBam function to get the Z value so I have no real control over it's operation.

Lloyd,

You won't see it any menu.
The keyboard 'Z' key acts as a 'push to make' switch, the plugin works only when the 'switch' is ON.
While keeping that key depressed, move the mouse over a surface you created or loaded first.
Z values will appear in the bottom log window, they appear as fast as you move the mouse to a new coordinate, so if your PC is on the slow side, move the mouse slowly or release the 'z' key while you move to another area of interest on the surface.
« Last Edit: October 13, 2018, 20:47:49 pm by EddyCurrent » Logged
Bob La Londe
CNC Jedi
*****
Offline Offline

Posts: 3365


^ 8.5 pounds on my own hand poured bait.


View Profile WWW
« Reply #6 on: October 13, 2018, 21:41:50 pm »

Step files are imported as a bunch of mesh elements.  It should work. 
Logged

Getting started on CNC?  In or passing through my area?
If I have the time I'll be glad to show you a little in my shop. 

Some Stuff I Make with CamBam
http://www.CNCMOLDS.com
lloydsp
CNC Jedi
*****
Online Online

Posts: 7626



View Profile
« Reply #7 on: October 13, 2018, 22:17:18 pm »

Eddy, I understood all that.  But I might have not understood one thing.

Does this only work on 'surfaces', but not on drawing objects?

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3607



View Profile
« Reply #8 on: October 13, 2018, 22:19:41 pm »

Title of thread = "Plugin to find Z level of a surface at the cursor position"   Wink

not on other entities
« Last Edit: October 13, 2018, 22:28:16 pm by EddyCurrent » Logged
lloydsp
CNC Jedi
*****
Online Online

Posts: 7626



View Profile
« Reply #9 on: October 13, 2018, 22:30:09 pm »

I understood the name, but for some reason thought it might work on all primitives (at least hoped so!).

Lloyd
« Last Edit: October 13, 2018, 22:37:13 pm by lloydsp » Logged

"Pyro for Fun and Profit for More Than Fifty Years"
lloydsp
CNC Jedi
*****
Online Online

Posts: 7626



View Profile
« Reply #10 on: October 13, 2018, 22:36:22 pm »

And it works fine on a surface.

(I wish it worked on any primitive!  I have a number of files where defining elements are down below Z, and rotated from flat.)

Thanks, Eddy!

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3607



View Profile
« Reply #11 on: October 13, 2018, 22:39:01 pm »

I'll change the code and try other entities

Edit: No, the CamBam function, GetZAtPoint, works with Surfaces only.
« Last Edit: October 13, 2018, 22:44:37 pm by EddyCurrent » Logged
lloydsp
CNC Jedi
*****
Online Online

Posts: 7626



View Profile
« Reply #12 on: October 13, 2018, 22:58:03 pm »

Well, thanks for trying!

Andy!  Oh, ANDY!  Wink

Lloyd
Logged

"Pyro for Fun and Profit for More Than Fifty Years"
Dragonfly
CNC Jedi
*****
Offline Offline

Posts: 2015



View Profile
« Reply #13 on: Yesterday at 11:05:02 »

While we are at it I'd very much like to have something like what I drew on the attached picture.
An information function displaying coordinates and size of a selected object or a group of objects.  Anchor point (corners or center of selection) is selected by the user.
It can be incorporated in the toolbar, the status bar, a docker or a floating window. It will be very helpful when positioning objects relative to machining coordinates origin when doing CAM preparation work.
Such functionality is implemented one way or another in many drawing programs.
'Get object extremas' works but why it must be called explicitly every time when it can be always active when at least one object is selected?

(Side note: If, eventually,  David adds anchor point selection to the absolute coordinate positioning in his 'Num muve' plugin it will be invaluable. Smiley  'Num move' and 'Aligner' are the most used by me plugins and I can't imagine now working without them.)
(Side note 2: CamBam's 'Align' function actually does the absolute positioning and perhaps the coordinate info with selectable anchor points can be incorporated into it. So that the user can enter the needed values based on that info.)

On the attached picture I need to move all objects so that the upper left corner of the selected rectangle is at X/Y 0/0. Currently I have to read the rectangle lower left corner coordinates and it size, then do some calculations in my head or with a calculator to determine the coordinates of the upper left corner,  and then do a move or align entering the calculated value. By selecting the upper left corner and reading its coordinates from the info window I can enter the movement value without much hassle.
And those are action every one of us does constantly while working on a project.


* CB_Info.jpg (190.98 KB, 780x545 - viewed 9 times.)
Logged

Before asking a question do some effort and walk through all menus and options in CamBam.  Maybe the answer is there. Please.
EddyCurrent
CNC Jedi
*****
Offline Offline

Posts: 3607



View Profile
« Reply #14 on: Yesterday at 11:39:53 »

Until then, did you try this plugin ? http://www.atelier-des-fougeres.fr/Cambam/Aide/Plugins/CBubble.html

What you propose is okay but what happens when there are many points in the object ? as you say David's plugin with anchor points is the best answer.
« Last Edit: Yesterday at 11:42:52 by EddyCurrent » Logged
Pages: [1] 2
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines

Valid XHTML 1.0! Valid CSS! Dilber MC Theme by HarzeM
Page created in 0.144 seconds with 20 queries.

Copyright © 2018 HexRay Ltd. | Sitemap