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

Toolbar for configuring the grid and axes #94

Merged
merged 12 commits into from
Jan 13, 2023
Merged

Conversation

hbcarlos
Copy link
Contributor

@hbcarlos hbcarlos commented Jan 11, 2023

Creates a toolbar to configure the axes on each view. By default, the axes are hidden and only added by the user.

Grabacion.de.pantalla.2023-01-12.a.las.12.18.40.mov

@hbcarlos hbcarlos added bug Something isn't working enhancement New feature or request labels Jan 11, 2023
@hbcarlos hbcarlos self-assigned this Jan 11, 2023
@github-actions
Copy link
Contributor

Binder 👈 Launch a Binder on branch hbcarlos/jupytercad/grid

@martinRenou
Copy link
Member

I'd personally be in favor of not having a grid in the 3D view at all. And instead just show 3 axes like freecad does (see my comment here: #83 (comment)).

Also, having the grid settings be set that way (through jlab settings) makes it independent from the opened file, which is odd because different 3D objects would have different orientations and sizes: a grid that makes sense for electric_razor.fcstd would not make sense for plane.fcstd.

@martinRenou
Copy link
Member

martinRenou commented Jan 11, 2023

We could also use something simple like the following instead of trying to create 3D axes that are not bound to the 3D view:

const axesHelper = new THREE.AxesHelper(1000000);
scene.add(axesHelper);

@trungleduc
Copy link
Member

We could also use something simple like the following instead of trying to create 3D axes that are not bound to the 3D view:

const axesHelper = new THREE.AxesHelper(1000000);
scene.add(axesHelper);

I think I could also remove the old axes in this PR, I can add a new one in the corner of the screen. just like in the freecad interface.

@hbcarlos
Copy link
Contributor Author

In my opinion, having the grid and axe helps to situate the objects when creating a 3D object. We should leave it there so users can add or remove it as they wish.

@hbcarlos
Copy link
Contributor Author

Also, having the grid settings be set that way (through jlab settings) makes it independent from the opened file, which is odd because different 3D objects would have different orientations and sizes: a grid that makes sense for electric_razor.fcstd would not make sense for plane.fcstd

This PR stores the grid's settings on each model and is not persisted or shared.

@martinRenou
Copy link
Member

In my opinion, having the grid and axe helps to situate the objects when creating a 3D object.

There is no grid in freecad and it works just fine. I'd say we follow freecad as much as we can.

src/schema/axe.json Outdated Show resolved Hide resolved
src/model.ts Outdated Show resolved Hide resolved
@hbcarlos
Copy link
Contributor Author

I removed the grid, removed the axe schema, and moved the view-related properties to the view.

src/toolbar/helpertoolbar.tsx Outdated Show resolved Hide resolved
src/toolbar/helpertoolbar.tsx Outdated Show resolved Hide resolved
src/toolbar/helpertoolbar.tsx Outdated Show resolved Hide resolved
src/toolbar/toolbar.tsx Outdated Show resolved Hide resolved
src/widget.tsx Outdated Show resolved Hide resolved
@trungleduc
Copy link
Member

Thanks @hbcarlos, I'm working on #79 so that we can pass the UI test.

@trungleduc
Copy link
Member

I'm working on #96, i will merge this PR after updating the snapshots with the bot

@trungleduc
Copy link
Member

trungleduc commented Jan 12, 2023

Galata, please update snapshots

@hbcarlos
Copy link
Contributor Author

@trungleduc
Copy link
Member

I need to update the script, the bot runs on every comment added after the magic phrase.

@trungleduc
Copy link
Member

trungleduc commented Jan 13, 2023

Galata please update snapshots

@trungleduc
Copy link
Member

Galata please update snapshots, again

@hbcarlos hbcarlos merged commit 323d3ec into jupytercad:main Jan 13, 2023
@hbcarlos hbcarlos deleted the grid branch January 13, 2023 10:45
trungleduc added a commit that referenced this pull request Jan 13, 2023
commit 323d3ec
Merge: aa8ca1a a5d9d27
Author: Carlos Herrero <[email protected]>
Date:   Fri Jan 13 11:45:14 2023 +0100

    Merge pull request #94 from hbcarlos/grid

    Toolbar for configuring the grid and axes

commit a5d9d27
Author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Date:   Fri Jan 13 10:40:49 2023 +0000

    Update Playwright Snapshots

commit af0784d
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 12:25:05 2023 +0100

    Small fix

commit 96fff01
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 12:16:52 2023 +0100

    Review

commit 2726f3e
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 12:08:12 2023 +0100

    Update src/toolbar/helpertoolbar.tsx

    Co-authored-by: Duc Trung Le <[email protected]>

commit aa6259e
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 12:08:02 2023 +0100

    Update src/toolbar/helpertoolbar.tsx

    Co-authored-by: Duc Trung Le <[email protected]>

commit 80dabca
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 12:07:53 2023 +0100

    Update src/toolbar/helpertoolbar.tsx

    Co-authored-by: Duc Trung Le <[email protected]>

commit e1c1003
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 09:07:20 2023 +0100

    Removes axe from schemas

commit d428486
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 09:06:36 2023 +0100

    Removes grid

commit 7164149
Author: Carlos Herrero <[email protected]>
Date:   Thu Jan 12 08:52:14 2023 +0100

    Remove view-related properties from the DocumentModel

commit 0f5f9f2
Author: Carlos Herrero <[email protected]>
Date:   Wed Jan 11 16:44:14 2023 +0100

    Lint

commit 682c469
Author: Carlos Herrero <[email protected]>
Date:   Wed Jan 11 16:37:14 2023 +0100

    Create a configurable axe

commit d642f18
Author: Carlos Herrero <[email protected]>
Date:   Wed Jan 11 14:59:33 2023 +0100

    Creates a toolbar to configure the grid helper
@martinRenou
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants