不规则形状的Ifc构件顶点坐标获取

今天有人问我,ifc构件的顶点坐标怎么获取,自己前年的时候写过类似的程序,但有点记不清了,最近一直用C++解析ifc,慎重起见,还是重新再写一次,java版本的获取方式如下,有空了再尝试一下C#版本的怎么写。

public static void getVertex(IfcProduct ifcProductParam) {
IfcProductRepresentation productRepresentation =ifcProductParam.getRepresentation();
LIST<IfcRepresentation> listRepresentation =productRepresentation.getRepresentations();
for(int k=0;k<listRepresentation.size();k++)
{
IfcShapeRepresentation shapeRepresentation=(IfcShapeRepresentation) listRepresentation.get(k);
SET<IfcRepresentationItem> ifcRepresentationItemSet = shapeRepresentation.getItems(); for(IfcRepresentationItem ifcRepresentationItemObj:ifcRepresentationItemSet) {
String className1 = ifcRepresentationItemObj.getClass().getName();
//System.out.println(className1+" "+ifcRepresentationItemSet.size());
if(className1.contains("IfcPolyline")) {
IfcPolyline ifcPolylineObj = (IfcPolyline) ifcRepresentationItemObj;
LIST<IfcCartesianPoint> ifcCartesianPointList = ifcPolylineObj.getPoints();
for(IfcCartesianPoint ifcCartesianPointObj:ifcCartesianPointList) {
LIST<IfcLengthMeasure> ifcLengthMeasureList=ifcCartesianPointObj.getCoordinates();
for(IfcLengthMeasure ifcLengthMeasureObj:ifcLengthMeasureList) {
System.out.print(ifcLengthMeasureObj+" ");
}
System.out.println("");
}
}else if(className1.contains("IfcExtrudedAreaSolid")) {
IfcExtrudedAreaSolid ifcExtrudedAreaSolidObj = (IfcExtrudedAreaSolid) ifcRepresentationItemObj;
IfcProfileDef ifcProfileDef=ifcExtrudedAreaSolidObj.getSweptArea();
//IfcArbitraryClosedProfileDef IfcArbitraryClosedProfileDef=(IfcArbitraryClosedProfileDef) ifcExtrudedAreaSolidObj.getSweptArea();
String profileDefClassName = ifcProfileDef.getClass().getName();
//System.out.println("=="+profileDefClassName); //常规轮廓
if(profileDefClassName.contains("IfcRectangleProfileDef")) {
IfcRectangleProfileDef ifcRectangleProfileDef = (IfcRectangleProfileDef) ifcProfileDef; //中心点
IfcAxis2Placement2D ifcAxis2Placement2D = ifcRectangleProfileDef.getPosition();
IfcCartesianPoint ifcCartesianPoint = ifcAxis2Placement2D.getLocation();
LIST<IfcLengthMeasure> ifcLengthMeasureList= ifcCartesianPoint.getCoordinates(); System.out.println("Coordinates:");
for(IfcLengthMeasure ifcLengthMeasureObj:ifcLengthMeasureList) {
System.out.print(ifcLengthMeasureObj+"\t");
}
System.out.println(""); //长
IfcPositiveLengthMeasure ifcPositiveLengthMeasureX =ifcRectangleProfileDef.getXDim();
System.out.println("XDim:"+ifcPositiveLengthMeasureX); //宽
IfcPositiveLengthMeasure ifcPositiveLengthMeasureY =ifcRectangleProfileDef.getYDim();
System.out.println("YDim:"+ifcPositiveLengthMeasureY); }
//不规则轮廓
else if(profileDefClassName.contains("IfcArbitraryClosedProfileDef")) {
IfcArbitraryClosedProfileDef ifcArbitraryClosedProfileDef = (IfcArbitraryClosedProfileDef) ifcProfileDef;
IfcCurve ifcCurve = ifcArbitraryClosedProfileDef.getOuterCurve();
String ifcCurveClassName = ifcCurve.getClass().getName();
//System.out.println("==="+ifcCurveClassName);
if(ifcCurveClassName.contains("IfcPolyline")) {
IfcPolyline ifcPolyline = (IfcPolyline) ifcCurve;
LIST<IfcCartesianPoint> ifcCartesianPointList=ifcPolyline.getPoints();
for(IfcCartesianPoint ifcCartesianPointObj:ifcCartesianPointList) {
LIST<IfcLengthMeasure> ifcLengthMeasureList=ifcCartesianPointObj.getCoordinates();
//两个坐标值分开存储的,需要遍历才能获得
for(IfcLengthMeasure ifcLengthMeasureObj:ifcLengthMeasureList) {
System.out.print(ifcLengthMeasureObj+"\t");
}
System.out.println("");
}
}
}
}
}
} }

--------------IfcWallStandardCase
0.0 0.0
12240.0 0.0
Coordinates:
6120.0 3.90798504668055E-13
XDim:12240.0
YDim:239.999999999997
--------------IfcWallStandardCase
0.0 0.0
4400.0 -0.0
Coordinates:
2200.0 -7.105427357601E-15
XDim:4400.0
YDim:240.0
--------------IfcWallStandardCase
0.0 0.0
12637.650181761 -0.0
12637.650181761 -120.0
11122.349818239 120.0
0.0 120.0
0.0 -120.0
12637.650181761 -120.0
--------------IfcWallStandardCase
0.0 0.0
7222.81601221758 -0.0
7222.81601221758 -120.0
7144.83528512168 120.0
1515.30036352204 120.0
0.0 -120.0
6970.46507840039 -120.0
7222.81601221758 -120.0
--------------IfcWallStandardCase
0.0 0.0
1532.81489663935 0.0
1532.81489663935 -120.0
1532.81489663935 120.0
77.9807270958989 120.0
0.0 -120.0
1292.81489663935 -120.0
1532.81489663935 -120.0
--------------IfcWallStandardCase
0.0 0.0
1991.65605265947 0.0
Coordinates:
995.828026329733 0.0
XDim:1991.65605265947
YDim:239.999999999997
--------------IfcWallStandardCase
0.0 0.0
1000.0 0.0
Coordinates:
500.000000000001 -6.3948846218409E-14
XDim:1000.0
YDim:240.0
--------------IfcWallStandardCase
0.0 0.0
4000.0 0.0
Coordinates:
2000.0 0.0
XDim:4000.0
YDim:239.999999999997
--------------IfcWallStandardCase
0.0 0.0
1713.19293543784 -0.0
Coordinates:
856.596467718918 -1.98951966012828E-13
XDim:1713.19293543784
YDim:240.0

不规则形状的Ifc构件顶点坐标获取的更多相关文章

  1. 不规则的Ifc构件顶点提取方法

    BIM模型中有很多不规则的构件,在IFC中这些不规则的构件一般用顶点的形式表示,顶点坐标提取路径:  IfcObject->IfcProductDefinitionShape->IfcSh ...

  2. 获取IFC构件的位置数据、方向数据

    获取IFC构件的位置数据.方向数据 std::map<int, shared_ptr<BuildingEntity>> map_buildingEntity = b_model ...

  3. cocos2d-x 不规则形状按钮的点击判定

    cocos2d-x 不规则形状按钮的点击判定 原理: 1.OpeGL ES提供了glReadPixels[^footnote]函数,来获取当前framebuffer上的像素数据 2.cocos2d-x ...

  4. Unity 制作不规则形状button

    在游戏开发中,我们有时需要制作不规则形状的按键. Unity3d中使用UGUI的Button控件只能实现规则的长方形按钮.而通过给Button的Image组件添加对应的贴图(sprite)我们可以实现 ...

  5. osg::NodeVisitor中计算一个节点对应的世界变换矩阵、法向量、顶点坐标

    class MyNodeVisitor:public osg::NodeVisitor { pulic: MyNodeVisitor():osg::NodeVisitor(osg::NodeVisit ...

  6. 使用Win32 API创建不规则形状&带透明色的窗口

    前一阵突然想起了9月份电面某公司实习时的二面题,大概就是说怎么用Win32 API实现一个透明的窗口,估计当时我的脑残答案肯定让面试官哭笑不得吧.所以本人决定好好研究下这个问题.经过一下午的摸索,基本 ...

  7. C#的百度地图开发(三)依据坐标获取位置、商圈及周边信息

    原文:C#的百度地图开发(三)依据坐标获取位置.商圈及周边信息 我们得到了百度坐标,现在依据这一坐标来获取相应的信息.下面是相应的代码 public class BaiduMap { /// < ...

  8. 根据高德API知道坐标获取详细地址信息

    /** * 根据坐标获取具体地址 * @param coor 坐标字符串 * @return */ public static String getAdd(String coor){ String u ...

  9. 不规则形状的Mask动画

    不规则形状的Mask动画 效果 源码 https://github.com/YouXianMing/Animations // // MaskShapeViewController.m // Anim ...

随机推荐

  1. 【笔记】MAML-模型无关元学习算法

    目录 论文信息: Finn C, Abbeel P, Levine S. Model-agnostic meta-learning for fast adaptation of deep networ ...

  2. Pthon面向对象-补充知识

    Pthon面向对象-补充知识 作者:尹正杰 版权声明:原创作品,谢绝转载!否则将追究法律责任. 一.tracemalloc 标准库tracemalloc,可以统计内存使用情况,通过下面的案例可以看出内 ...

  3. 如何解决IntelliJ idea的maven工程提示的Cannot Resolve Symbol

    IDEA无法识别一个类类,将其显示为红色,如果 compile 没有问题.鼠标放上去后显示 “Cannot resolve symbol XXX”,有两种解决方式:(1)点击菜单中的 “File” - ...

  4. [Reprint] Difference Between Job, Work, And Career

    https://www.espressoenglish.net/difference-between-job-work-and-career/ A lot of English learners co ...

  5. 【深入ASP.NET原理系列】--Asp.Net Mvc和Asp.Net WebForm实际上共用一套ASP.NET请求管道

    .NET FrameWork4在系统全局配置文件(如在如下目录中C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Config) 中添加了一个名字叫Url ...

  6. MySQL 日期格式化,取年月日等相关操作

    日期取年.月.日 select id, phone,time,year(time),month(time), DAY(time),TIME(time) from user where phone='x ...

  7. Linux端口转发工具rinetd

    介绍:Rinetd是为在一个Unix和Linux操作系统中为重定向传输控制协议(TCP)连接的一个工具.Rinetd是单一过程的服务器,它处理任何数量的连接到在配置文件etc/rinetd中指定的地址 ...

  8. youtobe视频下载

    不用安装,只要把视频地址链接复制过来就好. 1 https://en.savefrom.net/#helper_install 2 https://www.clipconverter.cc/ 3 ht ...

  9. Windbg命令脚本流程控制语句详解

    在Windbg命令脚本一文里,我们介绍了命令脚本语言的的组成要素,在本文里将对语句进行展开的讲解.这些语句主要是流程控制的语句,比如我们常见的条件分子和循环语句等. ; (命令分隔符) 分号(:)字符 ...

  10. 手把手教你用Python代码实现微信聊天机器人 -- Python wxpy

    关注我,每天都有优质技术文章推送,工作,学习累了的时候放松一下自己. 本篇文章同步微信公众号 欢迎大家关注我的微信公众号:「醉翁猫咪」 来学习了,微信聊天机器人. 环境要求: Windows / Li ...