中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當(dāng)前位置: 首頁(yè) > news >正文

自個(gè)網(wǎng)站媒體軟文推廣平臺(tái)

自個(gè)網(wǎng)站,媒體軟文推廣平臺(tái),百度seo規(guī)則,wordpress阿里云esc前言 Revit 有一套完整的幾何造型能力,每一個(gè)體量都是一個(gè)GenericForm,這些體量可以通過拉伸、掃掠等創(chuàng)建。這個(gè)例子介紹如何將他們合并成一個(gè)體量。 內(nèi)容 合并體量的關(guān)鍵接口: // Autodesk.Revit.DB.Document public GeomCombination Com…

前言

Revit 有一套完整的幾何造型能力,每一個(gè)體量都是一個(gè)GenericForm,這些體量可以通過拉伸、掃掠等創(chuàng)建。這個(gè)例子介紹如何將他們合并成一個(gè)體量。

內(nèi)容

在這里插入圖片描述
合并體量的關(guān)鍵接口:

// Autodesk.Revit.DB.Document
public GeomCombination CombineElements(CombinableElementArray members);

可以合并的實(shí)體,相關(guān)類的集成體系:
在這里插入圖片描述
如何通過UI創(chuàng)建各種類型的實(shí)體,可以參考 Revit 官方文檔:創(chuàng)建實(shí)心形狀

case 1:手動(dòng)選中了一些元素

核心邏輯:

  1. 遍歷所有選中元素
  2. 確保元素是GenericForm,且是實(shí)體solid
  3. 確保都是 CombinableElementGenericForm集成自CombinableElement,這步有點(diǎn)多余)
  4. 合并符合條件的元素: doc.Document.CombineElements(solids)

核心代碼:

// 遍歷所有選中元素
foreach (Autodesk.Revit.DB.ElementId elementId in doc.Selection.GetElementIds())
{Autodesk.Revit.DB.Element element = doc.Document.GetElement(elementId);// 確保元素是`GenericForm`,且是實(shí)體solidGenericForm gf = element as GenericForm;if (null != gf && !gf.IsSolid)continue;// 確保都是 `CombinableElement` (`GenericForm`集成自`CombinableElement`,這步有點(diǎn)多余)CombinableElement ce = element as CombinableElement;if (null != ce)solids.Append(ce);
}
// 合并符合條件的元素
doc.Document.CombineElements(solids);

case 2:沒有選中,則處理整個(gè)文檔

核心邏輯:

  1. 過濾出所有的GenericFormGeomCombination
  2. 遍歷過濾元素
  3. 確保元素是GenericForm,且是實(shí)體solid
  4. 確保都是 CombinableElementGenericForm集成自CombinableElement,這步有點(diǎn)多余)
  5. 對(duì)有重疊的元素進(jìn)行幾何合并:JoinOverlapping,判斷是否重疊的邏輯在 IsOverlapped

核心代碼:

// 過濾出所有的`GenericForm`和`GeomCombination`
LogicalOrFilter filter = new LogicalOrFilter(new ElementClassFilter(typeof(GenericForm)), new ElementClassFilter(typeof(GeomCombination)));
// 遍歷過濾元素
FilteredElementIterator itor = (new FilteredElementCollector(document)).WherePasses(filter).GetElementIterator();
itor.Reset();
while (itor.MoveNext()){// 確保元素是`GenericForm`,且是實(shí)體solidGenericForm gf = itor.Current as GenericForm;if (null != gf && !gf.IsSolid)continue;// 確保都是 `CombinableElement` (`GenericForm`集成自`CombinableElement`,這步有點(diǎn)多余)CombinableElement ce = itor.Current as CombinableElement;if (null == ce)continue;m_elements.Add(ce);
}
// 對(duì)有重疊的元素進(jìn)行幾何合并
GeomCombination geomCombination = JoinOverlapping(m_elements, document);

JoinOverlapping 的核心邏輯在于判斷是否重疊的邏輯, IsOverlapped

  1. 獲取元素幾何,GeometryElement get_Geometry(Options options)
  2. 獲取GeometryObject所有Face
    類型是 Solid,通過接口 solid.Faces
    類型是 GeometryElement, 通過 GetEnumerator 接口遞歸調(diào)用
  3. 獲取所有的線 GetAllCurves
    首先獲取所有的 Face,通過 face.EdgeLoops 獲取線的幾何信息
  4. 判斷線和面是否相交

部分核心代碼:

// 獲取元素幾何
Options geOptions = Command.s_appCreation.NewGeometryOptions();
elementA.get_Geometry(geOptions);// 獲取所有的 Face,需要遞歸調(diào)用
private static void GetAllFaces(GeometryElement geoElement, List<Face> faces){IEnumerator<GeometryObject> Objects = geoElement.GetEnumerator();while (Objects.MoveNext()){GeometryObject geObject = Objects.Current;GetAllFaces(geObject, faces);}
}
private static void GetAllFaces(Solid solid, List<Face> faces){foreach (Face face in solid.Faces){faces.Add(face);}
}
private static void GetAllFaces(GeometryObject geometry, List<Face> faces){if (geometry is GeometryElement){GetAllFaces(geometry as GeometryElement, faces);return;
}if (geometry is Solid){GetAllFaces(geometry as Solid, faces);return;}
}// 獲取所有的 curve,類似,省略

其它

這個(gè) sample 代碼質(zhì)量有些混亂,需自行整理分析。

http://www.risenshineclean.com/news/46617.html

相關(guān)文章:

  • wordpress+Apache升級(jí)seo深圳網(wǎng)絡(luò)推廣
  • wordpress安裝云服務(wù)器紹興網(wǎng)站快速排名優(yōu)化
  • 豐鎮(zhèn)網(wǎng)站建設(shè)福州百度推廣排名
  • 一個(gè)網(wǎng)絡(luò)空間如何做兩個(gè)網(wǎng)站百度關(guān)鍵詞推廣條件
  • 網(wǎng)站建設(shè)與微店網(wǎng)絡(luò)營(yíng)銷推廣及優(yōu)化方案
  • 上海十大網(wǎng)站建電商網(wǎng)絡(luò)營(yíng)銷
  • app網(wǎng)站開發(fā)成本seo推廣崗位職責(zé)
  • 房地產(chǎn)網(wǎng)站制作seo搜索引擎優(yōu)化
  • wordpress模板添加授權(quán)廣州網(wǎng)站排名優(yōu)化報(bào)價(jià)
  • 響應(yīng)式網(wǎng)頁(yè)設(shè)計(jì)最方便快速seo網(wǎng)站推廣計(jì)劃
  • 有哪些制作網(wǎng)站的公司嗎鹽酸達(dá)泊西汀片是治療什么的藥物
  • 視頻網(wǎng)站做視頻節(jié)目賺錢嗎推廣互聯(lián)網(wǎng)推廣
  • 做的好的中醫(yī)網(wǎng)站廣州新聞熱點(diǎn)事件
  • 電子通訊錄網(wǎng)站建設(shè)近日網(wǎng)站收錄查詢
  • 國(guó)外網(wǎng)站為什么不用備案軟件推廣接單平臺(tái)
  • 做網(wǎng)站應(yīng)該注意哪些方面臨沂seo推廣外包
  • 網(wǎng)站首頁(yè)被掛黑鏈百度網(wǎng)盤會(huì)員
  • 如何做好公司網(wǎng)站接推廣app任務(wù)的平臺(tái)
  • 學(xué)完ssm可以做哪些網(wǎng)站搜索引擎優(yōu)化的內(nèi)部?jī)?yōu)化
  • wordpress圖片網(wǎng)站網(wǎng)站要怎么創(chuàng)建
  • 成都 商業(yè)網(wǎng)站建設(shè)app網(wǎng)絡(luò)推廣公司
  • 網(wǎng)站建設(shè) 樂視百度軟件中心下載安裝
  • 網(wǎng)站優(yōu)化推廣怎么做強(qiáng)強(qiáng)seo博客
  • 網(wǎng)站群系統(tǒng)站長(zhǎng)工具網(wǎng)站排名
  • 湖州網(wǎng)站制作網(wǎng)站快速排名推廣軟件
  • 24小時(shí)二手表網(wǎng)站免費(fèi)友情鏈接平臺(tái)
  • thinkphp做網(wǎng)站有什么好處seo網(wǎng)絡(luò)優(yōu)化平臺(tái)
  • 門戶網(wǎng)站是指網(wǎng)絡(luò)營(yíng)銷方式有哪些
  • 南京h5網(wǎng)站開發(fā)seo根據(jù)什么具體優(yōu)化
  • 怎么查網(wǎng)站備案信息查詢運(yùn)營(yíng)是做什么的