Closed Belrius closed 4 years ago
You can call the geometry engine functions directly to get the BREP
Create an Instance of XbimGeomtryEngine Then call the relevant function to create a BREPSolid, shell, face etc
If you look in the test project there are loads of examples of how to do this
Hi Steve,
Yes, that’s what I’m doing at the moment, thank you.
I was wondering if these were stored and could be reached from the shapeInstances, as these have references to the material ID’s. IXBimGeometry objects don’t.
I think I am getting to understand the code well enough that I can find ways around it though.
Many thanks for your reply.
Andrew
OK sorry Andrew, I didn’t realise you were the person wanting to materialise faces etc. I just responded a bit blind. I have started some work on this in the version 6 branch and hit a few issues below
There are a couple of approaches
These all have different merits and problems
The approach I have adopted so far in Version 6 is a combination of 2 and 3. Extend the XbimShape objects to be aware of materials but to store/persist the information in the OCC native object (because XbimShapes are volatile). i.e. pass the material information down as we build the shapes and potentially give every shape an explicit material ID, so no cascading (Maybe stop at faces). Alternatives would be to give every OCC shape a unique ID and keep a managed dictionary linking material and shape (maybe a multiValueDictionary), this may have some issues with object lifecycle management and garbage collection, it could mean all objects are kept alive for a lot longer.
Bit of a ramble, sorry
Thanks Steve,
I’ll spend some time digesting this and get back to you.
Best regards Andrew
Hi Steve,
I’d figured that this must have been a complex task. Boolean intersections of objects with different materials were not something I’d considered but I can see how it would be a nightmare.
My use case is much simpler than this in general.
I think with the improved understanding that I have of how the back end works I can apply my own logic for the application of materials in my limited use case now.
Still keen to touch base, but I’m not sure how useful I’ll be in the heroic battle you have on your hands with providing a general purpose solution.
Best regards Andrew
Hi guys,
Apologies, something’s come up. Could we postpone or cancel this meeting?
Regards Andrew
From: Andrew Hoadley Sent: Friday, 25 September 2020 3:22 PM To: xBimTeam/XbimGeometry reply@reply.github.com; xBimTeam/XbimGeometry XbimGeometry@noreply.github.com Cc: Author author@noreply.github.com; Greg Lane greg.lane@situsystems.com Subject: RE: [xBimTeam/XbimGeometry] Are IXBimGeometryObjects available in scene or are they just intermediates to create XBimShapeGeometry? (#284)
Hi Steve,
I’d figured that this must have been a complex task. Boolean intersections of objects with different materials were not something I’d considered but I can see how it would be a nightmare.
My use case is much simpler than this in general.
I think with the improved understanding that I have of how the back end works I can apply my own logic for the application of materials in my limited use case now.
Still keen to touch base, but I’m not sure how useful I’ll be in the heroic battle you have on your hands with providing a general purpose solution.
Best regards Andrew
From: Andrew Hoadley Sent: Tuesday, 22 September 2020 5:30 PM To: xBimTeam/XbimGeometry reply@reply.github.com<mailto:reply@reply.github.com>; xBimTeam/XbimGeometry XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com> Cc: Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: RE: [xBimTeam/XbimGeometry] Are IXBimGeometryObjects available in scene or are they just intermediates to create XBimShapeGeometry? (#284)
Thanks Steve,
I’ll spend some time digesting this and get back to you.
Best regards Andrew
From: Steve Lockley notifications@github.com<mailto:notifications@github.com> Sent: Tuesday, 22 September 2020 5:05 PM To: xBimTeam/XbimGeometry XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com> Cc: Andrew Hoadley andrew.hoadley@situsystems.com<mailto:andrew.hoadley@situsystems.com>; Author author@noreply.github.com<mailto:author@noreply.github.com> Subject: Re: [xBimTeam/XbimGeometry] Are IXBimGeometryObjects available in scene or are they just intermediates to create XBimShapeGeometry? (#284)
OK sorry Andrew, I didn’t realise you were the person wanting to materialise faces etc. I just responded a bit blind. I have started some work on this in the version 6 branch and hit a few issues below
There are a couple of approaches
These all have different merits and problems
The approach I have adopted so far in Version 6 is a combination of 2 and 3. Extend the XbimShape objects to be aware of materials but to store/persist the information in the OCC native object (because XbimShapes are volatile). i.e. pass the material information down as we build the shapes and potentially give every shape an explicit material ID, so no cascading (Maybe stop at faces). Alternatives would be to give every OCC shape a unique ID and keep a managed dictionary linking material and shape (maybe a multiValueDictionary), this may have some issues with object lifecycle management and garbage collection, it could mean all objects are kept alive for a lot longer.
Bit of a ramble, sorry
From: Andrew H notifications@github.com<mailto:notifications@github.com> Sent: 22 September 2020 01:56 To: xBimTeam/XbimGeometry XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com> Cc: Steve Lockley steve.lockley@xbim.net<mailto:steve.lockley@xbim.net>; Assign assign@noreply.github.com<mailto:assign@noreply.github.com> Subject: Re: [xBimTeam/XbimGeometry] Are IXBimGeometryObjects available in scene or are they just intermediates to create XBimShapeGeometry? (#284)
Hi Steve,
Yes, that’s what I’m doing at the moment, thank you.
I was wondering if these were stored and could be reached from the shapeInstances, as these have references to the material ID’s. IXBimGeometry objects don’t.
I think I am getting to understand the code well enough that I can find ways around it though.
Many thanks for your reply.
Andrew
From: Steve Lockley notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com>> Sent: Monday, 21 September 2020 9:19 PM To: xBimTeam/XbimGeometry XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com%3cmailto:XbimGeometry@noreply.github.com>> Cc: Andrew Hoadley andrew.hoadley@situsystems.com<mailto:andrew.hoadley@situsystems.com<mailto:andrew.hoadley@situsystems.com%3cmailto:andrew.hoadley@situsystems.com>>; Author author@noreply.github.com<mailto:author@noreply.github.com<mailto:author@noreply.github.com%3cmailto:author@noreply.github.com>> Subject: Re: [xBimTeam/XbimGeometry] Are IXBimGeometryObjects available in scene or are they just intermediates to create XBimShapeGeometry? (#284)
You can call the geometry engine functions directly to get the BREP
Create an Instance of XbimGeomtryEngine Then call the relevant function to create a BREPSolid, shell, face etc
If you look in the test project there are loads of examples of how to do this
From: Andrew H notifications@github.com<mailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com<mailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com%3cmailto:notifications@github.com>>> Sent: 21 September 2020 07:46 To: xBimTeam/XbimGeometry XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com%3cmailto:XbimGeometry@noreply.github.com<mailto:XbimGeometry@noreply.github.com%3cmailto:XbimGeometry@noreply.github.com%3cmailto:XbimGeometry@noreply.github.com%3cmailto:XbimGeometry@noreply.github.com>>> Cc: Subscribed subscribed@noreply.github.com<mailto:subscribed@noreply.github.com<mailto:subscribed@noreply.github.com%3cmailto:subscribed@noreply.github.com<mailto:subscribed@noreply.github.com%3cmailto:subscribed@noreply.github.com%3cmailto:subscribed@noreply.github.com%3cmailto:subscribed@noreply.github.com>>> Subject: [xBimTeam/XbimGeometry] Are IXBimGeometryObjects available in scene or are they just intermediates to create XBimShapeGeometry? (#284)
Hi,
I'm looking to get a hold of the BRep representations of products.
Processing appears to go...
IIfcGeometricRepresentationItem -> XBimGeometryObjects -> XBimShapeGeometry -> XBimShapeInstance
XBimGeometryObjects like XBimSolid give access to these but I don't see a how to get to these working back from the XBimShapeInstance or XBimShapeGeometry from the scene.
Are they thrown away? In XBim3DModelContext I see that there is a class called XbimCreateContextHelper which seems to cache these so they can be used for CSG / Boolean operations. But they don't seem to be kept.
I can use XBimGeometryEngine to create these myself from each IIfcGeometricRepresentationItem. I seem to be getting frequent cases of corrupted memory when doing this though.
Not sure if these corruptions exist and are being caught when XBim creates the scene, or if creating the same object more than once is causing an issue?
Any thoughts on this welcome.
Many thanks Andrew
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/xBimTeam/XbimGeometry/issues/284, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6XPJJR5Y5XZCAAVGC5RRTSG3ZBHANCNFSM4RUFDEVQ.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/xBimTeam/XbimGeometry/issues/284#issuecomment-696052082, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AALHONILC6QC5AGN5V4PJ3LSG4ZDTANCNFSM4RUFDEVQ.
— You are receiving this because you were assigned. Reply to this email directly, view it on GitHubhttps://github.com/xBimTeam/XbimGeometry/issues/284#issuecomment-696457375, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AB6XPJMGBRPAF4TIIH7TVLDSG7YZRANCNFSM4RUFDEVQ.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHubhttps://github.com/xBimTeam/XbimGeometry/issues/284#issuecomment-696546490, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AALHONJPAZEPMITIJNKIYLTSHBEAPANCNFSM4RUFDEVQ.
[Admin note: I just tidied up the email chain a bit]
Hi,
I'm looking to get a hold of the BRep representations of products.
Processing appears to go...
IIfcGeometricRepresentationItem -> XBimGeometryObjects -> XBimShapeGeometry -> XBimShapeInstance
XBimGeometryObjects like XBimSolid give access to these but I don't see a how to get to these working back from the XBimShapeInstance or XBimShapeGeometry from the scene.
Are they thrown away? In XBim3DModelContext I see that there is a class called XbimCreateContextHelper which seems to cache these so they can be used for CSG / Boolean operations. But they don't seem to be kept.
I can use XBimGeometryEngine to create these myself from each IIfcGeometricRepresentationItem. I seem to be getting frequent cases of corrupted memory when doing this though.
Not sure if these corruptions exist and are being caught when XBim creates the scene, or if creating the same object more than once is causing an issue?
Any thoughts on this welcome.
Many thanks Andrew