本文整理汇总了C#中Polygon.CreateRegular方法的典型用法代码示例。如果您正苦于以下问题:C# Polygon.CreateRegular方法的具体用法?C# Polygon.CreateRegular怎么用?C# Polygon.CreateRegular使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Polygon
的用法示例。
在下文中一共展示了Polygon.CreateRegular方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateBaseTile
public static Tile CreateBaseTile( TilingConfig config )
{
Polygon boundary = new Polygon(), drawn = new Polygon();
boundary.CreateRegular( config.P, config.Q );
drawn = boundary.Clone();
//boundary.CreateRegular( 3, 10 );
//drawn.CreateRegular( 3, 8 );
//boundary.CreateRegular( 3, 7 );
//drawn = Heart();
//for( int i=0; i<drawn.NumSides; i++ )
// drawn.Segments[i].Center *= 0.1;
// Good combos:
// ( 5, 5 ), ( 10, 10 )
// ( 3, 10 ), ( 3, 9 )
// ( 6, 4 ), ( 6, 8 )
// ( 7, 3 ), ( 7, 9 )
Tile tile = new Tile( boundary, drawn, config.Geometry );
Tile.ShrinkTile( ref tile, config.Shrink );
return tile;
}
示例2: EdgeMobius
/// <summary>
/// This Mobius transform will center the tiling on an edge.
/// </summary>
public Mobius EdgeMobius()
{
Geometry g = Geometry2D.GetGeometry( this.P, this.Q );
Polygon poly = new Polygon();
poly.CreateRegular( this.P, this.Q );
Segment seg = poly.Segments[0];
Vector3D offset = seg.Midpoint;
double angle = Math.PI / this.P;
offset.RotateXY( -angle );
Mobius m = new Mobius();
m.Isometry( g, -angle, -offset );
return m;
}