怎么做网站备份,上海最新新闻头条,上海公司网站seo,常州微网站在skyline7.0版本以上增加了剖切的功能#xff0c;可参考源码开发自定义的剖切功能#xff0c;源码位置如图#xff1a; CrossSection中实现了绘制包围盒的方法。CrossSectionPopup中写了根据所绘制的Box#xff0c;对该区域进行剖切的功能#xff0c;主要原理参考代码可参考源码开发自定义的剖切功能源码位置如图 CrossSection中实现了绘制包围盒的方法。CrossSectionPopup中写了根据所绘制的Box对该区域进行剖切的功能主要原理参考代码
function showCrossSection() { setMove(); try { if (gBoxObj null) return; if (gLastPos null || !gLastPos.IsEqual(gBoxObj.Position)) { var vertices []; var sectionSize gBoxObj.Width * 5; gLastPos gBoxObj.Position.Copy(); var pos gBoxObj.Position; var planeTolarance gOriginBoxSize / 100; if (gBoxObj.Position.Pitch 90) { var yaw gBoxObj.Position.Yaw - 180; pos pos.Move(planeTolarance, yaw - 180, 0); // make sure the cut area doesnt include the box pos pos.Move(gBoxObj.Width / 2, 0, -90); pos pos.Move(gBoxObj.Width / 2, yaw 90, 0); vertices[0] pos; pos pos.Move(sectionSize, yaw - 180, 0); vertices[1] pos; pos pos.Move(gBoxObj.Width, yaw - 90, 0); vertices[2] pos; pos pos.Move(sectionSize, yaw, 0); vertices[3] pos; vertices[4] vertices[0].Move(gBoxObj.Width, 0, 90); vertices[5] vertices[1].Move(gBoxObj.Width, 0, 90); vertices[6] vertices[2].Move(gBoxObj.Width, 0, 90); vertices[7] vertices[3].Move(gBoxObj.Width, 0, 90); } else { pos pos.Move(planeTolarance, 0, 90); // make sure the cut area doesnt include the box pos pos.Move(gBoxObj.Width / 2, gBoxObj.Position.Yaw, 0); pos pos.Move(gBoxObj.Width / 2, gBoxObj.Position.Yaw 90, 0); vertices[0] pos; pos pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw - 180, 0); vertices[1] pos; pos pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw - 90, 0); vertices[2] pos; pos pos.Move(gBoxObj.Width, gBoxObj.Position.Yaw, 0); vertices[3] pos; vertices[4] vertices[0].Move(sectionSize, 0, 90); vertices[5] vertices[1].Move(sectionSize, 0, 90); vertices[6] vertices[2].Move(sectionSize, 0, 90); vertices[7] vertices[3].Move(sectionSize, 0, 90); } gGeometry SGWorld.Creator.GeometryCreator.CreateLineStringGeometry(vertices); // tmpBox SGWorld.Creator.CreatePolyline(geometry, $(#color).val(), 3, , dd); SGWorld.Analysis.ShowCrossSectionBox(gGeometry, false, #ff $(#color).val()); // } } catch (err) { } }
本人实现的效果如下