Skip to content

Commit 0c9be39

Browse files
authored
Merge pull request #30 from Frawak/fix/doc
Fix documentation
2 parents 976e79a + 68c33d1 commit 0c9be39

File tree

12 files changed

+94
-85
lines changed

12 files changed

+94
-85
lines changed

docs/Plots/Axiality.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
[preview]: img/Axiality.png "Axiality plot"
2+
[preview]: gfx/Axiality.png "Axiality plot"
33
<br/>
44
### Axiality plot
55

@@ -25,10 +25,11 @@ The plot can display a height axis. The range of the axis is determined by multi
2525

2626
```csharp
2727
var plot = new CylindricityPlot();
28-
var points = new List<CylinderPoint>();
28+
29+
var segment = new Segment<CylinderPoint, CylinderGeometry>( "All", SegmentTypes.Axis );
30+
plot.Segments.Add( segment )
2931

3032
var rand = new Random( DateTime.Now.Millisecond );
31-
var segment = new Segment( "All", SegmentTypes.Axis);
3233

3334
//The range of the displayed z-axis will be this height multiplied with the points height range.
3435
plot.Actual.Height = 10;
@@ -38,13 +39,13 @@ for( var i = 0; i < count; i++ )
3839
var deviation = 0.2 + rand.NextDouble() * 0.1;
3940
var height = (double)i / count;
4041

41-
var point = new CylinderPoint( segment, rand.NextDouble() * 0.1, height, deviation );
42-
points.Add( point );
42+
var point = new CylinderPoint( rand.NextDouble() * 0.1, height, deviation );
43+
44+
segment.Points.Add( point );
4345
}
4446

4547
plot.Tolerance = new Tolerance( -0.1, 0.1 );
4648
plot.DefaultErrorScaling = 100;
47-
plot.Points = points;
4849
```
4950

5051
#### Remarks

docs/Plots/Circle.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/Circle.png "Circle plot"
1+
[preview]: gfx/Circle.png "Circle plot"
22
<br/>
33
### Circle plot
44

@@ -23,23 +23,24 @@ Although the circle plot geometry has a radius parameter, it has no effect for d
2323

2424
```csharp
2525
var plot = new RoundnessPlot();
26-
var points = new List<CirclePoint>();
26+
27+
var segment = new Segment<CirclePoint, CircleGeometry>( "All", SegmentTypes.Circle );
28+
plot.Segments.Add( segment )
2729

2830
var rand = new Random( DateTime.Now.Millisecond );
29-
var segment = new Segment( "All", SegmentTypes.None );
3031

3132
for( var i = 0; i < count; i++ )
3233
{
3334
var angle = ( double ) i / count * 2.0 * Math.PI;
3435
var deviation = 0.1 * ( Math.Sin( angle ) + ( rand.NextDouble() - 0.5 ) * 0.2 );
3536

36-
var point = new CirclePoint( segment, angle, deviation );
37-
points.Add( point );
37+
var point = new CirclePoint( angle, deviation );
38+
39+
segment.Points.Add( point );
3840
}
3941

4042
plot.Tolerance = new Tolerance( -0.1, 0.1 );
4143
plot.DefaultErrorScaling = 100;
42-
plot.Points = points;
4344
```
4445

4546
#### Remarks

docs/Plots/CircleInProfile.md

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/CircleInProfile.png "Circle-in-profile plot"
1+
[preview]: gfx/CircleInProfile.png "Circle-in-profile plot"
22
<br/>
33
### Circle-in-profile plot
44

@@ -22,9 +22,11 @@ These special points can be part of the plots point list, but are usually define
2222

2323
```csharp
2424
var plot = new CircleInProfilePlot();
25-
var points = new List<CircleInProfilePoint>();
25+
26+
var segment = new Segment<CircleInProfilePoint, CircleInProfileGeometry>( "All", SegmentTypes.Line );
27+
plot.Segments.Add( segment )
28+
2629
var rand = new Random( DateTime.Now.Millisecond );
27-
var segment = new Segment( "All", SegmentTypes.Circle );
2830

2931
var angleShift = ( rand.NextDouble() - 0.5 ) * 0.25;
3032

@@ -33,45 +35,44 @@ for( var i = 0; i < count; i++ )
3335
var angle = (double)i / count * Math.PI;
3436

3537
var deviation = Math.Abs( Math.Sin( angle ) - Math.Sin( 0.25 * Math.PI ) ) * 0.1 + ( rand.NextDouble() - 0.5 ) * 0.005;
36-
var point = new CircleInProfilePoint( segment, angle + angleShift, deviation );
38+
var point = new CircleInProfilePoint( angle + angleShift, deviation );
3739

3840

3941
if( i == count / 4 )
4042
{
41-
plot.Nominal.FirstTouchingPoint = new CircleInProfilePoint( segment, angle, 0 );
43+
plot.Nominal.FirstTouchingPoint = new CircleInProfilePoint( angle, 0 );
4244

4345
//To create an angular tolerance, add it to the actual touching points.
4446
//The tolerance spans around the nominal touching point angle.
45-
plot.Actual.FirstTouchingPoint = new CircleInProfilePoint( segment, point.Angle, point.Deviation )
47+
plot.Actual.FirstTouchingPoint = new CircleInProfilePoint( point.Angle, point.Deviation )
4648
{
4749
Tolerance = new Tolerance( -0.1, 0.1 )
4850
};
4951
}
5052

5153
if( i == count / 4 * 3 )
5254
{
53-
plot.Nominal.SecondTouchingPoint = new CircleInProfilePoint( segment, angle, 0 );
55+
plot.Nominal.SecondTouchingPoint = new CircleInProfilePoint( angle, 0 );
5456

5557
//To create an angular tolerance, add it to the actual touching points.
5658
//The tolerance spans around the nominal touching point angle.
57-
plot.Actual.SecondTouchingPoint = new CircleInProfilePoint( segment, point.Angle, point.Deviation )
59+
plot.Actual.SecondTouchingPoint = new CircleInProfilePoint( point.Angle, point.Deviation )
5860
{
5961
Tolerance = new Tolerance( -0.1, 0.1 )
6062
};
6163
}
6264

6365
if( i == count / 2 )
6466
{
65-
plot.Nominal.MaxGapPoint = new CircleInProfilePoint( segment, angle, 0 );
66-
plot.Actual.MaxGapPoint = new CircleInProfilePoint( segment, point.Angle, point.Deviation );
67+
plot.Nominal.MaxGapPoint = new CircleInProfilePoint( angle, 0 );
68+
plot.Actual.MaxGapPoint = new CircleInProfilePoint( point.Angle, point.Deviation );
6769
}
68-
69-
points.Add( point );
70+
71+
segment.Points.Add( point );
7072
}
7173

7274
plot.Tolerance = new Tolerance( 0.1 );
7375
plot.DefaultErrorScaling = 250;
74-
plot.Points = points;
7576
```
7677
<br/>
7778
<br/>

docs/Plots/Cylindricity.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/Cylindricity.png "Cylindricity plot"
1+
[preview]: gfx/Cylindricity.png "Cylindricity plot"
22
<br/>
33
### Cylindricity plot
44

@@ -24,10 +24,11 @@ The plot can display a height axis. The range of the axis is determined by multi
2424

2525
```csharp
2626
var plot = new CylindricityPlot();
27-
var points = new List<CylinderPoint>();
27+
28+
var segment = new Segment<CylinderPoint, CylinderGeometry>( "All", SegmentTypes.Helix );
29+
plot.Segments.Add( segment )
2830

2931
var rand = new Random( DateTime.Now.Millisecond );
30-
var segment = new Segment( "All", SegmentTypes.Helix );
3132

3233
//The range of the displayed z-axis will be this height multiplied with the points height range.
3334
plot.Actual.Height = 10;
@@ -38,13 +39,13 @@ for( var i = 0; i < count; i++ )
3839
var deviation = 0.1 * ( Math.Sin( angle ) + ( rand.NextDouble() - 0.5 ) * 0.2 );
3940
var height = ( double ) i / count;
4041

41-
var point = new CylinderPoint( segment, angle, height, deviation );
42-
points.Add( point );
42+
var point = new CylinderPoint( angle, height, deviation );
43+
44+
segment.Points.Add( point );
4345
}
4446

4547
plot.Tolerance = new Tolerance( -0.1, 0.1 );
4648
plot.DefaultErrorScaling = 100;
47-
plot.Points = points;
4849
```
4950

5051
#### Remarks

docs/Plots/Defect.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/Defect.png "Defect file format"
1+
[preview]: gfx/Defect.png "Defect file format"
22
<br/>
33

44
### Defect plot
@@ -13,7 +13,7 @@ The defect file format is used to transport information about one or more defect
1313

1414
The format defines one point for every defect, which has a `Position` and a `Size` parameter. Be aware, that the `Position` refers to the corner of the defects bounding box, which is closest to the point of origin.
1515

16-
![defect position](img/DefectPosition.png "Defect position")
16+
![defect position](gfx/DefectPosition.png "Defect position")
1717

1818
Besides the `Position` and `Size` parameters, every point contains an arbitrary number of `Voxels` that define its shape. Be aware that both, the defect `Size` and `Position` as well as the voxel `Size` and `Position` are double values. We suggest to specify all positions and sizes in voxel coordinates and to specify the properties described in the [Geometry](#geometry) section.
1919

@@ -41,7 +41,9 @@ To allow PiWeb to create various visualizations of your data, you can specify ad
4141
public static Formplot Create( BitmapSource img )
4242
{
4343
var plot = new DefectPlot();
44-
var points = new List<Defect>();
44+
45+
var segment = new Segment<Defect, DefectGeometry>( "All", SegmentTypes.None );
46+
plot.Segments.Add( segment );
4547

4648
plot.Nominal.Size = new Vector( img.PixelWidth, img.PixelHeight );
4749

@@ -59,11 +61,10 @@ public static Formplot Create( BitmapSource img )
5961
continue;
6062

6163
if( IsDefect( position, data ) )
62-
points.Add( DetectDefect( new Pixel( x, y ), data, img.PixelWidth, img.PixelHeight, done ) );
64+
segment.Points.Add( DetectDefect( new Pixel( x, y ), data, img.PixelWidth, img.PixelHeight, done ) );
6365
}
6466
}
65-
66-
plot.Points = points;
67+
6768
return plot;
6869
}
6970
```
@@ -104,7 +105,7 @@ private static Defect DetectDefect( Pixel origin, byte[] data, int pixelWidth, i
104105

105106
var voxels = found.Select( p => new Voxel( new Vector( p.X, p.Y ), new Vector( 1, 1 ) ) ).ToArray();
106107
var bounds = GetBounds( voxels );
107-
return new Defect( new Segment( "All", SegmentTypes.None ), new Vector( bounds.X, bounds.Y ), new Vector( bounds.Width, bounds.Height ) )
108+
return new Defect( new Vector( bounds.X, bounds.Y ), new Vector( bounds.Width, bounds.Height ) )
108109
{
109110
Voxels = voxels
110111
};

docs/Plots/Fourier.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/Fourier.png "Fourier plot"
1+
[preview]: gfx/Fourier.png "Fourier plot"
22
<br/>
33
### Fourier plot
44

@@ -19,21 +19,21 @@ Fourier points consist of...
1919

2020
```csharp
2121
var plot = new FourierPlot();
22-
var points = new List<FourierPoint>();
22+
23+
var segment = new Segment<FourierPoint, EmptyGeometry>( "All", SegmentTypes.None );
24+
plot.Segments.Add( segment );
2325

2426
var rand = new Random( DateTime.Now.Millisecond );
25-
var segment = new Segment( "All", SegmentTypes.None );
2627

2728
// Harmonics are greater or equal to 1
2829
for( uint harmonic = 1; harmonic <= count; harmonic++ )
2930
{
3031
//No negative amplitudes
3132
var amplitude = ( 1.0 / (1.0 + ( double )harmonic / 1 ) + rand.NextDouble() * 0.2 ) * 0.0025;
32-
var point = new FourierPoint( segment, harmonic, amplitude ) { Tolerance = new Tolerance( null, 0.0003 ) };
33-
points.Add( point );
34-
}
33+
var point = new FourierPoint( harmonic, amplitude ) { Tolerance = new Tolerance( null, 0.0003 ) };
3534

36-
plot.Points = points;
35+
segment.Points.Add( point );
36+
}
3737
```
3838
#### Remarks
3939
* Be aware that the harmonic is stored as an unsigned integer value in network byte order (big endian) and its value must be greater than 0

docs/Plots/Generatrix.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/Generatrix.png "Generatrix plot"
1+
[preview]: gfx/Generatrix.png "Generatrix plot"
22
<br/>
33
### Generatrix plot
44

@@ -24,11 +24,13 @@ The plot can display a height and a radius axis. The range of these axis is dete
2424

2525
```csharp
2626
var plot = new CylindricityPlot();
27-
var points = new List<CylinderPoint>();
27+
28+
var left = new Segment<CylinderPoint, CylinderGeometry>( "Left", SegmentTypes.Line );
29+
var right = new Segment<CylinderPoint, CylinderGeometry>( "Right", SegmentTypes.Line );
30+
plot.Segments.Add( left );
31+
plot.Segments.Add( right );
2832

2933
var rand = new Random( DateTime.Now.Millisecond );
30-
var left = new Segment( "Left", SegmentTypes.Line);
31-
var right = new Segment( "Right", SegmentTypes.Line );
3234

3335
//The x- and y-axis of the plot will span over the radius and height * plotpoints min/max.
3436
plot.Actual.Height = 15;
@@ -39,16 +41,15 @@ for( var i = 0; i < count; i++ )
3941
var deviation = rand.NextDouble() * 0.1;
4042
var height = (double)i / count;
4143

42-
var point = new CylinderPoint( left, 0.0, height, deviation );
43-
points.Add( point );
44+
var point = new CylinderPoint( 0.0, height, deviation );
45+
left.Points.Add( point );
4446

45-
point = new CylinderPoint( right, 0.5 * Math.PI, height, deviation );
46-
points.Add( point );
47+
point = new CylinderPoint( 0.5 * Math.PI, height, deviation );
48+
right.Points.Add( point );
4749
}
4850

4951
plot.Tolerance = new Tolerance( -0.1, 0.1 );
5052
plot.DefaultErrorScaling = 100;
51-
plot.Points = points;
5253
```
5354

5455
#### Remarks

docs/Plots/Line.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/Line.png "Line plot"
1+
[preview]: gfx/Line.png "Line plot"
22
<br/>
33
### Line plot
44

@@ -24,10 +24,11 @@ The plot axis can be modified with the _actual_ geometry parameters `Length` and
2424

2525
```csharp
2626
var plot = new StraightnessPlot();
27-
var points = new List<LinePoint>();
27+
28+
var segment = new Segment<LinePoint, LineGeometry>( "All", SegmentTypes.None );
29+
plot.Segments.Add( segment );
2830

2931
var rand = new Random( DateTime.Now.Millisecond );
30-
var segment = new Segment( "All", SegmentTypes.None );
3132

3233
plot.Actual.Length = 5.0; //All positions will be multiplied with the length when the plot is drawn.
3334
@@ -40,14 +41,13 @@ for( var i = 0; i < pointCount; i++ )
4041
{
4142
var position = ( double ) i / pointCount;
4243
var deviation = 0.1 * ( Math.Sin( position * 2.0 * Math.PI ) + ( rand.NextDouble() - 0.5 ) * 0.1 );
43-
var point = new LinePoint( segment, position, deviation );
44+
var point = new LinePoint( position, deviation );
4445

45-
points.Add( point );
46+
segment.Points.Add( point );
4647
}
4748

4849
plot.Tolerance = new Tolerance( -0.1, 0.1 );
4950
plot.DefaultErrorScaling = 100;
50-
plot.Points = points;
5151
```
5252
#### Remarks
5353

docs/Plots/LineProfile.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[preview]: img/LineProfile.png "Curve plot"
1+
[preview]: gfx/LineProfile.png "Curve plot"
22
<br/>
33
### Line profile plot
44

@@ -20,10 +20,11 @@ While the points are specified as three dimensional entities, the plot displays
2020

2121
```csharp
2222
var plot = new CurveProfilePlot();
23-
var points = new List<CurvePoint>();
23+
24+
var segment = new Segment<CurvePoint, CurveGeometry>( "All", SegmentTypes.None );
25+
plot.Segments.Add( segment )
2426

2527
var rand = new Random( DateTime.Now.Millisecond );
26-
var segment = new Segment( "All", SegmentTypes.None );
2728

2829
var lastPosition = new Vector();
2930

@@ -44,14 +45,13 @@ for( var i = 0; i < count; i++ )
4445
if( i == 0 )
4546
continue;
4647

47-
var point = new CurvePoint( segment, position, direction, deviation );
48-
49-
points.Add( point );
48+
var point = new CurvePoint( position, direction, deviation );
49+
50+
segment.Points.Add( point );
5051
}
5152

5253
plot.Tolerance = new Tolerance( -0.1, 0.1 );
5354
plot.DefaultErrorScaling = 100;
54-
plot.Points = points;
5555
```
5656
<br/>
5757
<br/>

0 commit comments

Comments
 (0)