GithubHelp home page GithubHelp logo

Comments (13)

CBenghi avatar CBenghi commented on September 28, 2024 1

Glad to help.
You can probably filter the polygons by the z of their points to identify the ones on the ground level, if that's what you are after.

BTW, for your code above you could have used the
var space = model.Instances.OfType<IfcSpace>().Where(x=>x.Name == "04100");
or
var space = model.Instances[11891] as IfcSpace;

from xbimgeometry.

CBenghi avatar CBenghi commented on September 28, 2024

Hello,
Could you send an image or file with the space you are talking about?
I'm failing to visualise what are the inner edges that you wish to have access to.
Thanks,
Claudio

from xbimgeometry.

CBenghi avatar CBenghi commented on September 28, 2024

Ok, so here's a copy of the space I've received via email.

image

What you want to do is to identify the boundaries of the highlighted voids?

from xbimgeometry.

VegardAaberge avatar VegardAaberge commented on September 28, 2024

That is what I thought, but looking at this I realize that it is actually a collection of polygons, who are triangulated.

Hence, if that is always the case for triangulated polygons, then I do not need to find the inner regions. I can just use the border for each polygon.

So you might have solved my problem.

from xbimgeometry.

CBenghi avatar CBenghi commented on September 28, 2024

I'm leaving the stripped element of the question attached here for everybody's reference.
Ark_Kontor.ifc.stripped.ifc.zip

Closing.

from xbimgeometry.

theebow avatar theebow commented on September 28, 2024

Sorry for this question but as we have been working on the ifcSpace intersection element for some days i wonder something :
All our Revit IfcSpace export (ifc4) are in sweptSolid mode with extrudeareaSolid, and i see in your ifc file that you exported the ifcSpace in the brep format, do you know how do you do this ?
thanks
The only difference that i see is you are in 2x3 and we are in 4, so if you unknow why, be aware of the ifc4 export ;)

from xbimgeometry.

theebow avatar theebow commented on September 28, 2024

@VegardAaberge Be aware that the first item in :
var item = space.Representation.Representations.First.Items.First as IfcFacetedBrep;
will not be always the representation you are looking for, you could have the mesh/swept/.. one first
;o)

from xbimgeometry.

VegardAaberge avatar VegardAaberge commented on September 28, 2024

Thanks for all the help so far :)

I took a better look at the space, and used excel to draw the triangle faces. It looks like the triangles are overlapping, hence why I can't draw it. I tried both to close and not to close the triangles, but there was still overlap.

I tried to get the edges, but edges also gave me the triangle edges on the floor, and I realized it is not a collection of polygons, what we can see is the different height for the roof.

So then I am wondering, what I do need to get the outer boundary, and the inner boundaries for the floor as shown in CBenghi drawing. Does Xbim have support for that?

untitled

from xbimgeometry.

VegardAaberge avatar VegardAaberge commented on September 28, 2024

theebow: I did not make this model, it was given to me. Most models use sweptSolid, and some use normal Brep. I do not know how to do it in Revit. Potentially like this https://knowledge.autodesk.com/support/revit-lt/learn-explore/caas/CloudHelp/cloudhelp/2015/ENU/RevitLT-Model/files/GUID-0536F8BE-FA0B-4CEE-A0A7-2C2D4171234D-htm.html

However, what I do know, is that every space that has been triangulated, has had drill holes. The points that has a lot of lines, is actually a small circle.

from xbimgeometry.

mwymwy avatar mwymwy commented on September 28, 2024

It looks like you're not reconstructing polylines correctly from your triangulated data.
Triangulated data should look like :

P 1 56 30 108 6
V 7,42802194117213,26,5087487750701,0 7,42802194117213,26,5087487750701,2,5 7,42802194117213,31,2320047801504,0 7,42802194117213,31,2320047801504,2,5 4,17420219612907,31,2320047801504,0 4,17420219612907,31,2320047801504,2,5 4,07101165165724,31,2320047801504,0 4,07101165165724,31,2320047801504,2,5 3,44850668842043,31,2320047801504,0 3,44850668842043,31,2320047801504,2,5 3,35363345403181,31,2320047801504,0 3,35363345403181,31,2320047801504,2,5 3,35363345403181,31,2570047801504,0 3,35363345403181,31,2570047801504,2,5 3,29549708842043,31,2570047801504,0 3,29549708842043,31,2570047801504,2,5 2,44167033655252,31,2570047801504,0 2,44167033655252,31,2570047801504,2,5 2,44167033655252,31,2320047801504,0 2,44167033655252,31,2320047801504,2,5 1,70657116483947,31,2320047801504,0 1,70657116483947,31,2320047801504,2,5 1,70657116483947,30,2787493638109,0 1,70657116483947,30,2787493638109,2,5 1,70657116483947,29,7287493638109,0 1,70657116483947,29,7287493638109,2,5 1,70657116483947,29,1787493638109,0 1,70657116483947,29,1787493638109,2,5 1,70657116483947,28,6287493638109,0 1,70657116483947,28,6287493638109,2,5 1,70657116483947,28,3837495992835,0 1,70657116483947,28,3837495992835,2,5 1,70816643707538,28,3837495992835,0 1,70816643707538,28,3837495992835,2,5 3,23657114462616,28,3837495992835,0 3,23657114462616,28,3837495992835,2,5 3,53657114462543,28,3837495992835,0 3,53657114462543,28,3837495992835,2,5 3,53657114462543,28,9837495992835,0 3,53657114462543,28,9837495992835,2,5 3,58657114462543,28,9837495992835,0 3,58657114462543,28,9837495992835,2,5 3,58657114462543,28,3587495992835,0 3,58657114462543,28,3587495992835,2,5 3,58657114462543,27,6587493638108,0 3,58657114462543,27,6587493638108,2,5 3,56157114462543,27,6587493638108,0 3,56157114462543,27,6587493638108,2,5 3,56157114462542,26,3337493638,0 3,56157114462542,26,3337493638,2,5 3,8049758926033,26,3337493638,0 3,8049758926033,26,3337493638,2,5 3,89011852021488,26,3337493638,0 3,89011852021488,26,3337493638,2,5 7,42802194117213,26,3337493638,0 7,42802194117213,26,3337493638,2,5
N 1,0,0 0,1,0 -1,0,0 0,-1,0 0,0,-1 0,0,1
T 1/0,0,2 3,1,2
T 3/1,2,4 5,3,4
T 5/1,4,6 7,5,6
T 7/1,6,8 9,7,8
T 9/1,8,10 11,9,10
T 11/0,10,12 13,11,12
T 13/1,12,14 15,13,14
T 15/1,14,16 17,15,16
T 17/2,16,18 19,17,18
T 19/1,18,20 21,19,20
T 21/2,20,22 23,21,22
T 23/2,22,24 25,23,24
T 25/2,24,26 27,25,26
T 27/2,26,28 29,27,28
T 29/2,28,30 31,29,30
T 31/3,30,32 33,31,32
T 33/3,32,34 35,33,34
T 35/3,34,36 37,35,36
T 37/0,36,38 39,37,38
T 39/3,38,40 41,39,40
T 41/2,40,42 43,41,42
T 43/2,42,44 45,43,44
T 45/1,44,46 47,45,46
T 47/2,46,48 49,47,48
T 49/3,48,50 51,49,50
T 51/3,50,52 53,51,52
T 53/3,52,54 55,53,54
T 55/0,54,0 1,55,0
T 0/4,54,52 50,48,44 52,50,44 0,52,44 44,48,46 0,44,42 2,0,40 0,42,40 36,34,38 32,30,28 34,32,28 2,40,4 4,40,6 38,34,26 34,28,26 40,38,8 6,40,8 8,38,10 12,10,14 38,26,24 10,38,22 38,24,22 14,10,18 10,22,18 14,18,16 18,22,20
T 53/5,55,1 45,49,51 45,51,53 45,53,1 47,49,45 43,45,1 41,1,3 41,43,1 39,35,37 29,31,33 29,33,35 5,41,3 7,41,5 27,35,39 27,29,35 9,39,41 9,41,7 11,39,9 15,11,13 25,27,39 23,39,11 23,25,39 19,11,15 19,23,11 17,19,15 21,23,19

Where each line starting with T is a face splitted in a list of triangles. (the /x that can be specified after the first point of a triangle gives you the index of the normal of that face. Useful for detecting if a face is facing upward or downward or anything else)

You can work on a single face (a list of triangles) to construct an outline by iterating and merging triangles in your outline if they share an edge with.

Some tweaking can let you then detect outer and inner outline, by detecting if a point is inside or outside the face and by detecting if two edges of your outline are identical.

I hope this may help

from xbimgeometry.

mwymwy avatar mwymwy commented on September 28, 2024

In your last picture, it seems that you are constructing every possible triangle from a face, which gives you a result where triangles are overlapping. Either you are drawing multiple faces on same graph ?

from xbimgeometry.

theebow avatar theebow commented on September 28, 2024

Hi,
finally it seem we not really understand what you want to do with your space but give a look at the xBimGeometryCreator::CreateSolid(any representation of your Space) in the Geometry engine project
it return a XbimSolid object wich have property Edges, Faces.....
perhaps it what you need/search
;)

from xbimgeometry.

VegardAaberge avatar VegardAaberge commented on September 28, 2024

theebow If you look at my inital code, I do this _xbimGeometryCreator.CreateSolidSet(item); that is essentially the same as _xbimGeometryCreator.CreateSolid(item);
This gives me edges, and faces. However, the faces are just a list of triangles, and edges are just their borders. These edges intersect, which makes it very difficult to draw it.

mwymwy: You are right. Shamefully, my data doesn't look like that, I don't get faces with multiple triangles. I just get one triangle per face and I get about 3000 faces, and what you see above are those triangles. Maybe I can connect them somehow, but I figured out a solution to my problem.

What I will do is to pick the highest edge I can find, and then find all edges connected to this edge and choose the edge with the smallest clockwise angle that doesn't intersect a previous line. Then I can walk around the object and find the outside border. (I am not going to draw the inner regions.)

Hence, my issue is resolved. Again, thanks for all the help.

from xbimgeometry.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.