Preview plot - zoom to fit

More
7 years 10 months ago #122261 by workaholic
Hello,

Im searching and im not successful, I would like to have at preview plot a button which would fit the object in 3D preview or in X, Y, Z axis preview? So you dont need a mouse and zoom out / in everytime.

I haven't found any documentation how to edit preview plot for changing color, thickness or even more advanced programming - hacking.

Is this possible to be made at all?

Please Log in to join the conversation.

More
7 years 10 months ago #122390 by workaholic
I would like to show how this would look like:

Attachment not found



It has two additional buttons, which would:
First one with M in magnifying glass -> It means that Machine Area would fit to the screen of preview.
Second one with fit to zoom in magnifying glass -> It means that milling object would fit the screen.

Could anyone help me here?
I dont find any documentation about preview plot.

Please Log in to join the conversation.

More
7 years 10 months ago #122392 by cmorley
Replied by cmorley on topic Preview plot - zoom to fit
There is no documentation of the details of the plotting program.
It is possible to change colors by using a python handler file.
something like:
Code:
HAL_GREMLIN_NAME.colors['overlay_background'] = (0.0, 0.0, 0.57) # blue HAL_GREMLIN_NAME.colors['back'] = (0.0, 0.0, 0.75) # blue
I agree a fit-to-screen function would be good but you also have to agree what fit-to-screen is. If you reload the screen it fits to screen, but it includes the limit box -so the plot looks small.

Anyways here is where to look at the code:
hal_gremlin sub classes gremlin
hal_gremlin is in lib/python/gladevcp
gremlin is in src/emc/usr_intf

gremlin imports lots of libraries but glnav and glcannon are the most interesting

lib/python/rs274/glcannon.py
lib/python/glnav.py

In glnav, the function: set_eyepoint_from_extents() is probably the zoom-to-fit code.

Chris M

Please Log in to join the conversation.

More
7 years 9 months ago #125107 by Nico2017
Replied by Nico2017 on topic Preview plot - zoom to fit
Hi,
I actually have the reverse problem, I would like when opening a ngc file that the gremlin display does not zoom to fit and also does not affect the current rotation of the gremlin view. Any idea how to deactivate that too?

Thank you,

Nicolas

Please Log in to join the conversation.

More
7 years 9 months ago #125121 by cmorley
Replied by cmorley on topic Preview plot - zoom to fit
Somewhat.
In Qtvcp there is this function:
Code:
def reloadfile(self, w): dist = self.get_zoom_distance() try: self.load_program(None, self._reload_filename) self.set_zoom_distance(dist) except: print 'error', self._reload_filename pass

Probably the most full proof is change the function in gladevcp's hal_gremlin:
Code:
def fileloaded(self,w,f): dist = self.get_zoom_distance() self._reload_filename=f try: self._load(f) self.set_zoom_distance(dist) except AttributeError,detail: #AttributeError: 'NoneType' object has no attribute 'gl_end' print 'hal_gremlin: continuing after',detail

There is probably a way to do rotation too - but i would have to dig in the code.

Chris M

Please Log in to join the conversation.

Time to create page: 0.083 seconds
Powered by Kunena Forum