question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is it possible to change the default view?

See original GitHub issue

Hi, When i generate in cadquery code the view differs from the freecad view. Is it possible to adjust the perspective of the panes? Re-assign (1) the views of the panes to my preferred axis Re-assign (2) the iso view default coordinates

image

Currently i have to rotate the object to get the same behavior as in FreeCad. It works, but everytime i resize the window i have to click and drag to get the view correct and see the front. This generates a lot lot more click and i would like to prevent that. Or are there some other ideas how i might solve this?

(Everytime i move the window, or do a change, or re-render it… i have to rotate the object with the mouse again) image

Code Sample:

import cadquery as cq
from cq_server.ui import UI, show_object


height = 150.0
width = 50.0
depth = 100.0

r = cq.Workplane("front").box(width,height,depth)

r = r + cq.Workplane('top').text("YX / Top", 8, (height / 2) + 1)
r = r + cq.Workplane('bottom').text("XY / Bottom", 8, (height / 2) + 1)
r = r + cq.Workplane('front').text("ZX / Front", 8, (depth / 2) + 1)
r = r + cq.Workplane('back').text("XZ / Back", 8, (depth / 2) + 1)
r = r + cq.Workplane('left').text("ZY / Left", 8, (width / 2) + 1)
r = r + cq.Workplane('right').text("YZ / Right", 8, (width / 2) + 1)

r = r.rotate((0, 0, 0), (1, 0, 0), 90)
r = r.rotate((0, 0, 0), (1, 0, 180), 0)
show_object(r)

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
bernhard-42commented, Sep 11, 2022

Let’s keep it open to track points 2 and 3.

For the future, the dependencies are:

jupyter-cadquery --> cad-viewer-widget --\
                                          |--> three-cad-viewer
cadquery-server -------------------------/

jupyter-cadquery, cad-viewer-widget and three-cad-viewer are my projects, cadquery-server is maintained by @roipoussiere. I’d recommend to always first open an issue with cadquery-server since much of the logic “around” the viewer component is implemented there.

2reactions
bernhard-42commented, Sep 11, 2022

@snapo From the screenshot I derive, you are using cadquery-server, right? Jupyter-Cadquery shares the viewer (three-cad-viewer), however has nothing to do with cadquery-server.

Nevertheless, I think, these are three issues:

  1. Resizing browser window resets camera => needs to be fixed by cadquery-server
  2. A different camera position for the isometric view
  3. Swap back/front with left/right orientation button view to align with cadquery workplanes

Point 1 seems to be on the roadmap https://github.com/roipoussiere/cadquery-server/issues/37 Point 2 and 3 I will look into in the next release. It is an issue in three-cad-viewer, however bubbles up to Jupyter Cadquery

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I change the default view for Windows 10 File ...
1)Open any folder and set its view to "Details" (which is the one you want, right?) · 2)ON that same folder, click the...
Read more >
How do I change the default view in Word? - Jones IT
How do I change the default view in Word? · Click the File Tab, and then click Options. · Click Advanced. · Under...
Read more >
How do I change the Default view for eveyone or just myself?
Answer: · To change it for everyone, name the view Foundation Default View . An easy way to do this is to go...
Read more >
How to change your default view - YouTube
When you first login to My Stroke Guide, you will see all the conversations organised by Category. But there are other views for...
Read more >
How to Change File Explorer Default View in Windows 10?
Make Windows 10 File Explorer always open to This PC with this procedure. For some people changing the file explorer default view is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found