Skip to content

Implement ability to change model from the 3D Geometry Preview View (set Construction, ThermalZone, reverse Vertices)#863

Merged
jmarrec merged 15 commits into
developfrom
interactive_geometry
Mar 23, 2026
Merged

Implement ability to change model from the 3D Geometry Preview View (set Construction, ThermalZone, reverse Vertices)#863
jmarrec merged 15 commits into
developfrom
interactive_geometry

Conversation

@jmarrec

@jmarrec jmarrec commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator

jmarrec added 12 commits March 6, 2026 10:50
…showStory to sessionStorage and restore it

  - C++: Before calling refreshClicked(), runs a JS snippet that persists settings.renderBy and settings.showStory to sessionStorage. The reload only happens in the async callback, guaranteeing the save  completes first.
  - JS (initDatGui): At the end, reads those keys back, updates settings directly, calls updateDisplay() to sync the dat.GUI dropdown UI, then calls the normal update(). Keys are immediately removed so   the next manual refresh starts clean.

  This preserves the render mode (and story filter) across any mutation-triggered refresh, without touching the camera state or other settings.
@eringold

eringold commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

this is awesome. can you do a multi-select?

@jmarrec

jmarrec commented Mar 6, 2026

Copy link
Copy Markdown
Collaborator Author

Dude! let me be content for a day before asking for more 🙃

(I think that'd require a significant change)

}
}

void GeometryBridge::triangulateSurface(const QString& surfaceName) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, do you have a use case for this?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For sun-related things like shading, having a non convex surfaces (eg a L, H shaped roof) is a problem, so I could see myself wanting to do this. I don't know, I was just in the flow and thought about adding it so I just did.

}
}

void GeometryBridge::setOutsideBoundaryCondition(const QString& surfaceName, const QString& value) {

@macumber macumber Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Setting the adjacent surface could be cool, although I guess you can do that from the surface tab too.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a valid point.

You can also set the outside boundary condition and all from the surface tab too, it's just more tedious especially if you have auto-named surfaces like "Surface 114", which makes it quite hard to remember what you're touching.


function displaySelectedObjectContextMenu() {

contextMenu.innerHTML = '<h2>Actions</h2>';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a way to give this menu a close button?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, but is that necessary? Just click outside of it and it goes away. We don't have a close button on the left-click info panel (displaySelectedObjectDetails)


GeometryBridge::GeometryBridge(model::Model& model, QObject* parent) : QObject(parent), m_model(model) {}

void GeometryBridge::reverseSurfaceVertices(const QString& surfaceName) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set surface type could be useful as well.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that one definitely makes sense.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you think it would be worthwhile to add DisplayName and CadObjectId to the info messages if they exist?

@jmarrec jmarrec Mar 9, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not 100% sure if that's valuable for people or not. I'm guessing if you care about these, you're definitely using another 3D editor as the driver (eg: Rhino with Ladybug tools) and probably less likely to be trying to do that in the 3D GeometryPreview.

The question is whether this info is in the ThreeJSForwardTranslator export or not (I will have to check, cant remember)

It's a simple code change though for us, and most models won't have it, so I guess it would be fine to add it.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@macumber

macumber commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

This is really cool @jmarrec great job!

@macumber

macumber commented Mar 8, 2026

Copy link
Copy Markdown
Collaborator

Left some optional comments but approving as is.

@jmarrec
jmarrec merged commit 5d17b84 into develop Mar 23, 2026
10 checks passed
@jmarrec
jmarrec deleted the interactive_geometry branch March 23, 2026 13:33
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 23, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement ability to change model from the 3D Geometry Preview View (set Construction, ThermalZone, reverse Vertices)

3 participants