首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >EllipticArcSegment in SceneView

EllipticArcSegment in SceneView
EN

Stack Overflow用户
提问于 2022-08-07 18:07:49
回答 1查看 28关注 0票数 0

我想在SceneView中创建一个弧形。人们告诉我我必须使用EllipticArcSegment,它在MapView中工作,但我可以在SceneView中使用它。当我在EllipticArcSegment中使用ScenView时,我会得到一条线,而不是一条弧线。看这张照片。

代码语言:javascript
复制
public MainWindow()
{
InitializeComponent();
MySceneView.Scene = new Scene(BasemapStyle.ArcGISImageryStandard);
MyMapView.Map = new Map(BasemapStyle.ArcGISTopographic);

MapPoint _spain = new MapPoint(-4.00475, 40.637861, SpatialReferences.Wgs84);
Graphic _arc = CreateArc(_spain, 0.080, 90.0, 45.0);
Graphic _arc1 = CreateArc(_spain, 0.080, 90.0, 45.0);
_AiminginZone_GO.Graphics.Add(_arc);
_AiminginZone_GO1.Graphics.Add(_arc1);
MyMapView.GraphicsOverlays.Add(_AiminginZone_GO);
MySceneView.GraphicsOverlays.Add(_AiminginZone_GO1);
}

private Graphic CreateArc(MapPoint center, double radius, double arcAngle, double azimuth)
{

_AiminginZone_GO.Graphics.Clear();
_AiminginZone_GO1.Graphics.Clear();
// set up spatial references
SpatialReference wgs84 = SpatialReferences.Wgs84;
SpatialReference webMercator = SpatialReferences.WebMercator;
// make a point in lat/long (WGS84)
MapPoint centrePoint = new MapPoint(center.X, center.Y, 56, wgs84);
MapPoint centrePoint1 = new MapPoint(center.X+0.05, center.Y, 56, wgs84);
// project it to a mercator projection where the unit of measure is metres
MapPoint mercatorPoint = (MapPoint)GeometryEngine.Project(centrePoint, webMercator);
// create an arc segment which is 50Kilometers radius, starting at 90 degrees, the arc angle is 45 degrees clockwise
//EllipticArcSegment arcSegment = new EllipticArcSegment(centrePoint, mercatorPoint, (Math.PI / 180) * 90, true, true, (Math.PI / 180) * 90, (Math.PI / 180) * -45, wgs84);
EllipticArcSegment arcSegment = EllipticArcSegment.CreateCircularEllipticArc(mercatorPoint, 50000, (Math.PI / 180) * 90, (Math.PI / 180) * -45, webMercator);

// make a part with the segment
Part part = new Part(webMercator);
part.Add(arcSegment);

// create the line from the part
Polyline line = new Polyline(part);

// add it to a graphic and graphics overlay to allow us to visualise it
var polylineSymbol = new SimpleLineSymbol(SimpleLineSymbolStyle.Dash, System.Drawing.Color.Red, 3.0);
Graphic arcGraphic = new Graphic(line, polylineSymbol);
return arcGraphic;
}

在这里输入图像描述

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2022-08-09 11:01:46

有一个错误使用EllipticArcSegment.CreateCircularEllipticArc,请参阅链接有更多的信息格式。在这里输入链接描述

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/73269884

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档