Lathe tool image not displayed - Rear tools

More
11 Jun 2015 01:17 #59678 by Simmsey
I have a small slant bed lathe I am setting up on LinuxCNC.
As it has rear tool turret I am keen to get the display to match the machine with tools above/behind lathe spindle axis.

I have used the .axisrc file adaptions to switch the display as described a few places online.
if lathe:
 bind_axis("Down", "Up", 0)
 def set_view_y(event=None):
	widgets.view_z.configure(relief="link")
	widgets.view_z2.configure(relief="link")
	widgets.view_x.configure(relief="link")
	widgets.view_y.configure(relief="sunken")
	widgets.view_p.configure(relief="link")
	vars.view_type.set(4)
	o.reset()
	glRotatef(90, 1, 0, 0)
	glRotatef(90, 0, 1, 0)
	if o.canon:
 		mid = [(a+b)/2 for a, b in zip(o.canon.max_extents, o.canon.min_extents)]
 		glTranslatef(-mid[0], -mid[1], -mid[2])
 		size = [(a-b) for a, b in zip(o.canon.max_extents, o.canon.min_extents)]
 		o.set_eyepoint_from_extents(size[0], size[2])
 	else:
		o.set_eyepoint(5.)
	o.perspective = False
	o.lat = -90
	o.lon = 0
	o.tkRedraw()
  
TclCommands.set_view_y = commands.set_view_y = set_view_y
root_window.bind("v", commands.set_view_y)
root_window.after_idle(commands.set_view_y)

This achieves nearly all I need EXCEPT the lathe tool outline is not visible. I get a cross hatch for the control point and a few random pixels skating around where the tool should be. It appears to be drawing the tool outline incorrectly.
The tools draw perfectly if I don't use the .axisrc file view modifications.

Does anyone else have this issue? Is there a way to fix this?

Thanks

Simmsey

Please Log in or Create an account to join the conversation.

More
18 Jun 2015 00:10 #59916 by Simmsey
Attached some screen shots of the tool display problem as well as normal display when screen not flipped.
Does anyone else see this problem/bug?
Is there I can do about it? I can't find anything searching the forum.
I'm new to Linuxcnc. Should I raise a bug report?

LinuxCNC 2.6.8
Debian Wheezy

Thanks

Simmsey
Attachments:

Please Log in or Create an account to join the conversation.

More
18 Jun 2015 00:17 #59917 by Simmsey
Update:
I've tried some random tool table changes to see if I could get tools displayed correctly or just modify behaviour to understand it better.
I have tried various changes to front and backface angles - display very similar but with pixels at different angles.

The most different display I could achieve was by trying a negative tool tip dia. I know this shouldn't be sensible but it did then display more than just a few pixels.
Attached is the tool display with this setting in case this helps someone identify what's going wrong with the tool display.

Thanks

Simmsey
Attachments:

Please Log in or Create an account to join the conversation.

More
18 Jun 2015 04:14 #59924 by emcPT
I was trying to look for my own post but I could not find it.
I made in the past a small contribution that never received enough interest from others, so I never made real efforts to make it "generally available", but I use it myself. It displays a wire frame of the tool, with the advantage that you can "draw" your own tool using a python code.
I will try to send you snapshoots tomorrow if I have time.
This involves compiling the sources of linuxcnc, that I am not sure if you are comfortable with.

www.eusurplus.com
The following user(s) said Thank You: Simmsey

Please Log in or Create an account to join the conversation.

More
18 Jun 2015 05:38 #59926 by Simmsey
Thanks emcPT,

Thanks for confirming this is a known bug.

I haven't grappled with compiling from source code yet or how axis/linuxcnc is written. I don't have much Python experience at the moment.
I have had a lot to get up to speed with in getting the auto tool turret working and spindle coordinated motion etc.

I would be interested in your tool display routines/modifications. I'm now pretty happy with how LinuxCNC works and is running on the lathe so may have some time to learn how to do this.

Simmsey

Please Log in or Create an account to join the conversation.

More
18 Jun 2015 08:30 - 18 Jun 2015 08:31 #59928 by cmorley
I think the problem with the code is it actual just set the view looking up instead of down, rather then actually drawing things opposite handed.
IIRC the text will be rendered backwards.
then do to layers ( I suspect ) the tool is not visible.

To do this properly requires a much larger change in code so the view point is not changed, the drawing is changed.
Few linuxcnc developers are openGL experts, even less tkinker / openGL experts.


Chris M
Last edit: 18 Jun 2015 08:31 by cmorley.

Please Log in or Create an account to join the conversation.

More
18 Jun 2015 23:09 #59952 by emcPT
This is the best that I could do. It displays only wire frames.
If it interesting to you or someone else on the forum I can try to port my code to the latest development version and make it public. Maybe some one of the gurus can add it to the source code.
I also changed the tool direction to suit the "fanuc style" that is different from linuxcnc (for example tool tip direction on fanuc number 2 is on linuxcnc number 3).
Attachments:

Please Log in or Create an account to join the conversation.

Moderators: piasdom
Time to create page: 0.236 seconds
Powered by Kunena Forum