GSharker / G-Shark

G-Shark is a free and open-source geometry library designed for computational designers and software developers in the Architecture, Engineering, and Construction (AEC) industry.
https://gsharker.github.io/G-Shark/
MIT License
211 stars 36 forks source link

Implement Meshes #225

Closed cesarecaoduro closed 1 year ago

cesarecaoduro commented 3 years ago

Implement the base mesh class

AlanRynne commented 1 year ago

Hey @cesarecaoduro! Could you give me some insight on what Mesh type you were thinking of implementing for g-shark?

I would be happy to port my Mesh class from https://github.comparamdigma/core into G-Shark. It's a half-edge mesh implementation, but if you have any preference for any other mesh implementation I'd also be happy to look into it.

https://github.com/Paramdigma/Core/blob/master/src/Geometry/Mesh.cs

I'm looking into some fun tasks to accomplish through-out this Christmas and this sounds like a nice one! Anyway, happy to have a chat about this before getting started with anything.

d3ssy commented 1 year ago

Half-edge would be awesome! Yes pls!

AlanRynne commented 1 year ago

Perfect, I'll get the ball rolling by the end of the week. I may open a Draft PR first to start a discussion on implementation details, etc... once I have a working ported Mesh :D

d3ssy commented 1 year ago

Fantastic, Alan! Amazing to have you contributing! 💪

cesarecaoduro commented 1 year ago

Just catching up in the morning :) Amazing to have you contributing to Gshark. We’ve been in silent mode for quite some time due to different work commitments, but we’re planning to come back now. Mesh implementation was absolutely in the roadmap, as CSG and some form of BREP.

d3ssy commented 1 year ago

Just catching up in the morning :) Amazing to have you contributing to Gshark. We’ve been in silent mode for quite some time due to different work commitments, but we’re planning to come back now. Mesh implementation was absolutely in the roadmap, as CSG and some form of BREP.

IMHO we're not going to need CSG if we implement Brep, especially in terms of operations. The latter is more flexible and has wider applications. Is there a specific use case for CSG you had in mind?

cesarecaoduro commented 1 year ago

CSG is less computation intensive for simple operations (and sometimes all you need is a simple boolean), but I agree, if we manage to get BREP going, we can avoid developing CSG.

Sent from Outlook for iOShttps://aka.ms/o0ukef


From: Guido Maciocci @.> Sent: Tuesday, December 20, 2022 7:12:49 AM To: GSharker/G-Shark @.> Cc: Cesare Caoduro @.>; Mention @.> Subject: Re: [GSharker/G-Shark] Implement Meshes (#225)

Just catching up in the morning :) Amazing to have you contributing to Gshark. We’ve been in silent mode for quite some time due to different work commitments, but we’re planning to come back now. Mesh implementation was absolutely in the roadmap, as CSG and some form of BREP.

IMHO we're not going to need CSG if we implement Brep, especially in terms of operations. The latter is more flexible and has wider applications. Is there a specific use case for CSG you had in mind?

— Reply to this email directly, view it on GitHubhttps://github.com/GSharker/G-Shark/issues/225#issuecomment-1358239567, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AGJG6AYWWRYJR4BYTS5OEBLWOC6UDANCNFSM5BLP7EEA. You are receiving this because you were mentioned.Message ID: @.***>

AlanRynne commented 1 year ago

Not to hijack completely this conversation into a CSG vs Brep discussion... but if I were to choose I would choose both.

There is no good CSG library for C# that you can rely on to make mesh booleans for you afaik. It's 2 different use-cases for 2 different type of users I guess.

The way I see it, CSG is just a "set of procedural steps that result in a specific shape" and as such, could be applied to BREP generation too (or any type of geometry really), and it's a concept that is closer to Grasshopper than Rhino modelling. It also serialises into nothing (as opposed to serialising a Brep)

If you've ever manually created BREP's with rhinocommon you'll know of the pain in the ass that it is, and how easy it is to wreck the entire BREP data structure 😅 A CSG way of building those BREPs to me would be a dream, but it would still require having a working Brep class and working Brep intersection methods.

PS: Maybe a new issue should be opened for this 😅

d3ssy commented 1 year ago

New issue here: https://github.com/GSharker/G-Shark/issues/386#issue-1504814779

So yeah... We probably want both 😁