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

CSG Hollow #2069

Closed
Knetic opened this issue Feb 24, 2018 · 7 comments
Closed

CSG Hollow #2069

Knetic opened this issue Feb 24, 2018 · 7 comments
Assignees
Labels
Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. Type:Enhancement New features
Milestone

Comments

@Knetic
Copy link

Knetic commented Feb 24, 2018

Most Radiants have a "Hollow" feature, which takes the current brush and builds as many brushes as required to create a hollow shell around the volume it occupied - so a solid square brush becomes a hollow cube occupying the same area.

This is an equivalent operation to copying a brush, scaling it down by some uniform factor, then CSG subtracting it from the original brush. But since #871 is not yet complete, it's exceedingly difficult to hollow brushes with more than a few faces. And in general I think most people used to GTKRadiant or MOHRadiant or q3radiant would be used to having this feature.

If multiple brushes are selected, the operation just hollows each one individually (doesn't try to find some greater hull to hollow).

Hotkey could be H, menu item under "Edit->CSG".

I'm willing to do the work for this, it's not a crazy operation, but want to raise the issue first to make sure this wasn't an intentional omission.

@kduske
Copy link
Collaborator

kduske commented Feb 24, 2018

That sounds like a useful addition, yes. I appreciate any contributions.

@kduske kduske added Type:Enhancement New features Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. Status:Ready and removed Status:Ready labels Feb 24, 2018
@Knetic
Copy link
Author

Knetic commented Mar 2, 2018

I admit that i wasn't entirely prepared for the level of templating and complexity of the code, the most I was able to do was in the View classes and associated calls to a "csgHollow" method in Brush, but i admit that it's not at all clear to me how to properly modify the geometry of a brush - there's a lot of functionality there. I'm not able to meaningfully contribute like i expected 😞 I left my changes in a forked branch; if it helps anyone.

https://github.com/Knetic/TrenchBroom/tree/feature/2069

@kduske
Copy link
Collaborator

kduske commented Mar 2, 2018

@Knetic that's okay, the code is indeed complicated because it has grown over a long time. I'll have a look at this feature at some point in the future.

@ericwa
Copy link
Collaborator

ericwa commented Mar 23, 2018

What makes more sense, shrinking the reference brush an then subtracting, or growing and then subtracting?

I think it'd be more useful to grow and then subtract; i.e. if you start with a 128x128x128 brush, that would be the size of the hollow area after using this command. Radiant does it the other way though (shrinks by 1 grid increment, then subtract).

@kduske
Copy link
Collaborator

kduske commented Mar 23, 2018

There are good arguments for and against both. I don't think it matters too much, but grow then subtract might be a tad more useful because you can apply the textures from the outside of the brush to the inside of the hollowed section as is.

@ericwa ericwa self-assigned this Mar 24, 2018
@Knetic
Copy link
Author

Knetic commented Mar 24, 2018

The Radiant way (copy-shrink-subtract) makes it much easier to get results you'd expect.

It doesn't alter the dimensions of your shape, just converts it to a hollow shell. Any textures you applied to the faces of that brush stay in exactly the same place and size, visually, as when you applied them. And because the "walls" are in exactly the same places, you don't need to worry about how the "footprint" of the hollowed brush will end up. You simply block-out your level, and hollow the parts you want to be hollow - which doesn't change the shape or appearance of your level - just makes the hollowed parts hollow.

To put it in workflow terms, shrink-subtract follows the principle of least surprise - it's the same "brush", with all the same visual and spatial properties, just hollow.

@kduske kduske added this to the 2.1.0 milestone Mar 26, 2018
@ericwa
Copy link
Collaborator

ericwa commented Mar 29, 2018

Added in 1a77f76

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Prio:2 Medium priority: Non crash bugs that impede the user, features that add new functionality. Type:Enhancement New features
Projects
None yet
Development

No branches or pull requests

3 participants