不规则形状的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. ab 接口压力测试工具使用

    安装: yum install httpd-tools 使用: ab -n 1000 -c 100 http://www.baidu.com/; -n 总的请求数;  -c 并发数; -k 是否开启长 ...

  2. SMBus PEC

    SMBus一种I2C总线的变种 SMBus 提供了PEC方式,提高了传输的可靠性. 总线的发展都是在提高速度,提高可靠性或者提高传输效率上下功夫. PEC不具备纠错的能力,是在I2C link lay ...

  3. 米勒罗宾素数检测(Miller-Rabin)

    适用范围:较大数的较快素性判断 思路: 因为有好的文章讲解具体原理(见参考文章),这里只是把代码的大致思路点一下,读完了文章如果还有些迷糊,可以参考以下解释 原理是费马小定理:如果p是素数,则a^(p ...

  4. python2和python3切换

    (1)需要将python2和python3的环境变量设置好 (2)重命名主程序 然后我们分别把两个版本的 Python 主程序 exe 改下名,3.6 版本的改名为 python3.exe,2.7 版 ...

  5. wecenter系统关于标题及seo的修改

    wecenter整个系统好像根本就没有考虑过SEO优化,就连Title的识别也是随意的许多,在使用这个cms来完成我们自己的需求的时候,适当的修改是比不可少的.下面说说title标题修改方法. 今天分 ...

  6. Python开发应用-操作excel

    一. openpyxl读 95%的时间使用的是这个模块,目前excel处理的模块,只有这个还在维护 1.workBook workBook=openpyxl.load_workbook('path(. ...

  7. 在linux中使用Sqlplus命令登录MySQL,查看表并设置行数和宽度,使其正常显示

    在linux中使用sqlplus命令进入MySQL,设置行数和行宽   1) 查看目前的pagesize,默认是14: 1.      show pagesize;    2.      set pa ...

  8. 【Selenium-WebDriver实战篇】Java丨验证码图片去除干扰像素,方便验证码的识别(转)

    参考地址:https://www.cnblogs.com/haojieli/p/6212627.html 1.先来看看效果: 原图 除去干扰像素后 2.解析代码: 1).读取文件夹里面的图片 1 St ...

  9. StringTokenizer字符串分解器

    示例: StringTokenizer st = new StringTokenizer(key, ",", false); while (st.hasMoreTokens()) ...

  10. Java线程池(ExecutorService)使用

    一.前提 /** * 线程运行demo,运行时打出线程id以及传入线程中参数 */ public class ThreadRunner implements Runnable { private fi ...