[go: nahoru, domu]

Skip to content
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

Feature request - X/Y coordinate measurment labels. #359

Open
atorrey opened this issue Jan 19, 2013 · 7 comments
Open

Feature request - X/Y coordinate measurment labels. #359

atorrey opened this issue Jan 19, 2013 · 7 comments
Labels
feature request A request for new functionality or behavior

Comments

@atorrey
Copy link
atorrey commented Jan 19, 2013

One of the things that I use LibreCad for is to make drawings of parts that I will subsequently make on our Sharp 2-axis CNC mill. Unfortunately the only way that I have to program the mill is to manually enter the program information - I'm not sure if we have the ability to do remote programing, and even if so, the machine expects "G-code" which AFAIK LibreCad can't produce.

Making it more of a pain, is that the mill ONLY accepts X-Y coordinates of distance from a datum point. I can't find any way at present (Version: master SCM Revision: 2.0.0beta1
Compiled on: Jan 10 2013) to make LibreCad produce X-Y labels on the drawing the way that it does linear measurements.

The only way I've found to get the info I need is to create another layer in the drawing where I create point entities at the end of each line entity, or other feature of interest. I then move the drawing to put one of the points on the 0,0 grid position (this isn't essential, but it makes the rest easier) and turn off the display of everything except the points layer. I then select the points and do a "List Info" which gives their coordinates. After that, as a visual aid, I have to HAND COPY the coordinates onto a printout of the drawing....

Needless to say, this is a nuisance, and sort of begs the question of why we can't use a computer to do this grunt work....

If the measurement function could have the ability to print the X-Y coordinates of a selected point, I feel like it would be a useful addition. I wouldn't think this would be that terribly difficult, since the program already knows the cursor position.

@maikwoehl
Copy link

I think this, too. The exact coordinates of an entity are really important in some cases. And suddenly I think that a line is on a canvas a line with two different points and you already have informations about it's X/Y Coordinates. It shouldn't be a problem to print the coordinates out with a single command.

Okay, the points are displayed in the Info-Window of an object. But a tool for this would be nice.

@smallfix
Copy link

Guys can you please tell how you would like this thing to work? Cause I don't have experience with G-code.
I don't know if I will find some time to try that but it would be nice to get the idea of what you would like to have.
From what I've understood so far, it would be nice to have the coordinates of a selected entity (line, ...) printed/shown on the actual drawing.
So a command which would create a text field with the coordinates of the point, at the position of the point.
right?

@atorrey
Copy link
Author
atorrey commented Dec 19, 2013

First off, thanks for tackling this one - I suspect it won't be terribly hard to do, but I'm not a programmer, so that is just a guess on my part...

Yes, Smallfix, it's pretty much as you describe it, with the added ability to specify the 0,0 coordinate that the other points are measured from... I have two machines with different operating systems that I have to work with - one is an old Matsura VMC that uses G-code, the other is a Sharp mill with a proprietary "conversational" interface. In both cases having X / Y coordinates is incredibly helpful as you essentially are telling the tool to move the working point to different X/Y positions, with intermediate stuff that tells it what to do on the way... (Gross over-simplification, but good enough for this purpose)

In this case the working point is the location of the mill cutter, but G-code is pretty much the standard for most CNC machines, so it could be a plasma-cutter, laser, water-jet, 3-D printer head, and so on...

Essentially what is needed for this function is to have the ability to set the location of the 0,0 point and define the points of interest, which are mostly going to be line intersections, center points of curves and other such locations. Some machines have trouble with arcs more than a certain number of degrees, so the ability to add extra points on a feature is useful

As an example of how I solved the problem when I encountered it and was inspired to make the feature request which worked but was tedious even on my fairly simple part

  1. If the drawing's 0,0 point isn't where you will want it for coding, open a new drawing, and copy / paste the old one. (Use the desired 0,0 point for the reference, and paste it onto the origin in the new drawing)
  2. Create a new layer - be creative name it "points"
  3. Define the layer color and pen-size to be big enough to easily see...
  4. Using the Draw Points function, place a point at each point of interest on the drawing - following the expected tool path will help later.
  5. Hide ALL layers except points,
  6. Select All
  7. Use the "Info" -> "List entities" menu to get a list of the selected entities - which SHOULD be just the points
  8. Cut and paste the list into your favorite text editor - remove everything except the X / Y coordinates (optional - number the points)
  9. Copy from the text editor into the text tool on the drawing
  10. Map the list back to the points - can be done by pencil on a print, however I drew leader lines to each point and labeled them with the point numbers
  11. You are now (finally!) ready to start coding....

As I think is pretty obvious, being able to simply place a 0,0 point, and get the drawing to map the list of points would be a great help. Automating the 'point selection' process to at least some degree would be even better...

Another related function which might be nice to automate (if possible) is to generate "tool paths" on the drawing (and tie this to the point generating function) This is because G-code defines the path of travel that the CENTER of the tool follows. Since most tools have some width / diameter, if you simply have the tool follow the perimeter of the part in the drawing, the result will be the wrong size...

Most G-code using machines have some form of "tool-offset" function that lets you program in the exact size of the tool at runtime. This is the "technically correct" way to do the code, but can be a pain to write. Often it is easier to add a "tool path" line to the part drawing (essentially a line that parallels the perimeter the tool radius away) and code to follow that - as long as your tool is the right size, this works...

With the current program, it isn't a huge deal to do a parallel line, but it would be nice if this could be made at least semi-automatic. Otherwise it would be a longer process of switching between the straight line parallel tool, the curved line tool, and then making sure all the intersections met up properly...

Hope this helps - If you have more questions, feel free to ask...


Arthur Torrey - arthur_torrey@comcast.net

----- Original Message -----
From: smallfix notifications@github.com
To: LibreCAD/LibreCAD LibreCAD@noreply.github.com
Cc: Arthur Torrey arthur_torrey@comcast.net
Sent: Thu, 19 Dec 2013 09:58:59 -0000 (UTC)
Subject: Re: [LibreCAD] Feature request - X/Y coordinate measurment labels. (#359)

Guys can you please tell how you would like this thing to work? Cause I don't have experience with G-code.
I don't know if I will find some time to try that but it would be nice to get the idea of what you would like to have.
From what I've understood so far, it would be nice to have the coordinates of a selected entity (line, ...) printed/shown on the actual drawing.
So a command which would create a text field with the coordinates of the point, at the position of the point.
right?


Reply to this email directly or view it on GitHub:
#359 (comment)

@smallfix
Copy link

Because I'm not that much into the code base and I don't want to mess up the 2.0 release, I'll try to implement this as a plugin. The problem of using the plugin code instead of the "main" code is that it's really limited to some functions one can use (http://wiki.librecad.org/index.php/Document_Interface_class).

Yes, Smallfix, it's pretty much as you describe it, with the added ability to specify the 0,0 coordinate that the other points are measured from...

So first I was thinking of letting the user click at the points he/she would like to be labeled. But I can't find a way to do this (will have to ask the wiser devs if there is a workaround). My recent idea is letting the user create/draw the points.

  1. Create a new layer - be creative name it "points"
  2. Define the layer color and pen-size to be big enough to easily see...
  3. Using the Draw Points function, place a point at each point of interest on the drawing - following the expected
    tool path will (?) help later.
  4. Hide ALL layers except points
  5. Select All (maybe not needed, as it looks like I can get the visible points only)
  6. Select the plugin from the menu
  7. Select the new reference point (0,0 point)
  8. Hit OK/whatever button.

Another related function which might be nice to automate (if possible) is to generate "tool paths" on the drawing...

Too complicated for me ;)

1 If the drawing's 0,0 point isn't where you will want it for coding, open a
new drawing, and copy / paste the old one. (Use the desired 0,0 point for
the reference, and paste it onto the origin in the new drawing)

Is this essential for the process or can you also just create a new layer
and create the points and move all the points to the position desired?
(Modify->Move/Copy)

and define the points of interest, which are mostly going to be line intersections, center points of curves and other such locations

I was thinking of automating this. The problem is I can add labels to all the start/end points of the lines and center points of the arcs/circles but not to other points such intersections (when implementing this as a plugin). So instead the user has to draw the points he/she wants to be labeled.

@smallfix
Copy link

Ok I made a simple plugin. It works this way:

  1. Create a new layer (you have to name it "points")
    (2. Define the layer color and pen-size to be big enough to easily see...)
  2. Using the Draw Points function, place a point at each point of interest on the drawing
  3. Hide ALL layers except points
  4. Select the plugin from the menu
  5. Select the new reference point (0,0 point)
  6. Select the points you want to be labeled
  7. Hit OK/whatever button.

If this is an improvement for you and you want to use this please tell me if you want me to create a new branch in my repository or just give you a zip file with the plugin source.

@r-a-v-a-s
Copy link
Member

What happened to this plugin?
Was it tested?

The simple solution I imagine is a version of the leader tool
that produces the coordinates at the tail of the leader.
It could have an option to set a relative zero position.

@r-a-v-a-s r-a-v-a-s added the feature request A request for new functionality or behavior label Aug 9, 2015
@atorrey
Copy link
Author
atorrey commented Aug 10, 2015

I don't think it got tested, I'm not sure how the ball on that got dropped.

I think the version of the leader tool you are talking about is what I had in mind originally.

Having the ability to set a relative zero would be useful. Also possibly useful would be able to have a 'relative mode' where each point selected was automatically relative to the previous one.

G-code generally allows specifying only the axis that is changing on a given move, which can be handy on a rectangular sort of part, as it reduces the size of the program going into the machine - some of the older machines have very limited capacity, so this matters....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request A request for new functionality or behavior
Projects
None yet
Development

No branches or pull requests

4 participants