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

Better support for IfcAnnotations #92

Open
5 tasks
yorikvanhavre opened this issue Mar 23, 2022 · 12 comments
Open
5 tasks

Better support for IfcAnnotations #92

yorikvanhavre opened this issue Mar 23, 2022 · 12 comments
Labels
Feature New feature or request

Comments

@yorikvanhavre
Copy link
Owner

Have a solid, round-trippable support for 2D annotations (lines, texts, dimensions,...) in IFC, through IfcAnnotations.

Related issue @ BlenderBIM: IfcOpenShell/IfcOpenShell#2100

  • Support Draft Labels
  • Set ObjectType when exporting an IfcAnnotation. In FreeCAD I suppose we would have:
    • Dimensions
    • Linework
    • Texts
    • Areas/surfaces (faces and hatches)
    • Smart labels
    • Undefined (for all the rest I cannot think of)
  • For "usermade" labels, (a line + a text), find a way to export them as one single IfcAnnotation
  • Add IfcRelAssignsToProduct when exporting smart labels and dimensions (if associated to an object)
  • associate it with a drawing object in a group, or within a drawing (e.g. IfcDocumentInformation)
@Moult
Copy link
Contributor

Moult commented Mar 24, 2022

Cheers, most of these already have solutions worked on as part of the IfcOpenShell drawing module, so let's perhaps start with the easiest then work our way up. If you're curious on reading this is a good post to read: IfcOpenShell/IfcOpenShell#1153 (comment)

So to start with:

  1. Camera object will be stored in IFC as an IfcAnnotation, it must have an ObjectType of DRAWING. (Camera is Blender jargon, but it's basically the view foreground cutting plane + background cutting plane extents)
  2. IfcAnnotation[ObjectType="DRAWING"] must belong in a single IfcGroup
  3. The DRAWING annotation object must store an IfcBlock in the MODEL/Body/MODEL_VIEW subcontext.
  4. The DRAWING annotation object ObjectPlacement should have a rotation such that -Z points at the direction you are looking at in the section cut (i.e. same as BCF), +X points to the right, and +Y points up the drawing.
  5. The DRAWING annotation object should store a Pset called EPset_Drawing
    EPset_Drawing should contain: TargetView (enum to match subcontext TargetView attribute), Scale (IfcLabel, like "X/Y" where X and Y are integers)

Once you have these, that should be enough to get a drawing translated across. Hopefully the logic why we need each of these data should be obvious but if it isn't let me know and happy to have a call to explain the reasoning.

@yorikvanhavre
Copy link
Owner Author

Thanks for the detailed explanation. Okay, I think that's pretty easy to implement. Two questions:

  • Is the IfcBlock the shape representation of the IfcAnnotation/DRAWING? Then it's basically a "view cube"? That's handy, we have that data in FreeCAD already.
  • I never saw EPset prefix before... That's elegant, to differentiate from standard psets. Is that a standard? I can't find any reference...

@Moult
Copy link
Contributor

Moult commented Mar 24, 2022

Exactly, the IfcBlock is the "view cube". Everybody (I assume) needs a view cube to represent the full 3D drawing extents so I think it works well and is agnostic of camera properties.

"EPset_" is a little hack where something is a custom pset, but I consider it to be an extension of IFC itself or a workaround that is common to many implementations. It was an unofficial convention stablished by the georeferencing workarounds in IFC2X3 when IFC2x3 needed EPset_ProjectedCRS and EPset_MapConversion.

@theoryshaw
Copy link

following and excited. :)

@yorikvanhavre
Copy link
Owner Author

yorikvanhavre commented Mar 30, 2022

IMG_20220330_185208
I think we could achieve something good here, being able to design such things in either FreeCAD or Blender and render it in the other... I haven't looked deep into finer text styling, if things like font, alignment... are possible..

edit note to self: yes: add an IfcStyledItem + IfcTextStyle https://standards.buildingsmart.org/IFC/RELEASE/IFC4/ADD1/HTML/schema/ifcpresentationdefinitionresource/lexical/ifctextliteral.htm

@Moult
Copy link
Contributor

Moult commented Mar 30, 2022

By the way I always use IfcTextLiteralWithExtents because that gives me the option of using a BoxAlignment. The BlenderBIM Add-on has a tiny Style manager which includes all the 4 presentations styles (surface, curve, fillarea, and text).

Right now though the styles are done with CSS in SVG, however I do plan to let the IFC styles generate the CSS so they are linked.

@yorikvanhavre
Copy link
Owner Author

i like css and svg too.. the thing is how to transport drawings between, say 😇 blender and freecad, in a manner that they don't loose important things like text size and position. For now indeed having that in the ifc file is simple. but indeed, think of css-stylable cad drawings!

@yorikvanhavre
Copy link
Owner Author

oops, closed by mistake..

@yorikvanhavre
Copy link
Owner Author

yorikvanhavre commented Apr 6, 2022

As of FreeCAD/FreeCAD@b5a6970 IfcAnnotations exported from FreeCAD now have these possible ObjectType: LINEWORK,AREA,HATCH,LEADER,TEXT,DIMENSION, or None (empty string)

edit full list BlenderBIM + FreeCAD:
BREAKLINE
DIMENSION
DRAWING
EQUAL_DIMENSION
GRID
HIDDEN_LINE
MISC
PLAN_LEVEL
SECTION_LEVEL
STAIR_ARROW
TEXT
TEXT_LEADER
LEADER
HATCH
LINEWORK
AREA

@yorikvanhavre yorikvanhavre added the Feature New feature or request label Apr 7, 2022
@Moult
Copy link
Contributor

Moult commented Apr 15, 2022

A sample file that includes some sheet and drawing info :)

untitled.ifc.txt

@theoryshaw
Copy link

Related: A thread on how to codify dimension offsets in the IFC schema: https://community.osarch.org/discussion/1014/ifc-an-approach-for-dimension-line-offsets/

@theoryshaw
Copy link

theoryshaw commented Sep 7, 2022

To help fund this issue directly, OSarch created a 'bounty' here: https://opencollective.com/osarch/projects/roundtrip_ifc_annotation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants