Class Pdf3DCrossSection
Represents the clipping portion of the 3D artwork for the purpose of showing artwork cross sections.
Inheritance
Namespace: Syncfusion.Pdf.Interactive
Assembly: Syncfusion.Pdf.Portable.dll
Syntax
public class Pdf3DCrossSection : Object, IPdfWrapper
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
Constructors
Pdf3DCrossSection()
Initializes a new instance of the Pdf3DCrossSection class.
Declaration
public Pdf3DCrossSection()
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
Properties
Center
Gets or sets the center of the cutting plane.
Declaration
public float[] Center { get; set; }
Property Value
Type | Description |
---|---|
System.Single[] | The list of float value specifies the cutting plane of the section. |
Remarks
A three element array specifying the center of rotation on the cutting plane in world space coordinates.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Center = new float[] { 40, 40, 40 };
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Center = New Single() { 40, 40, 40 }
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
Color
Gets or sets the cutting plane color.
Declaration
public PdfColor Color { get; set; }
Property Value
Type | Description |
---|---|
PdfColor | PdfColor specifies the cutting plane color of the 3D cross section. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
IntersectionColor
Gets or sets the intersection color.
Declaration
public PdfColor IntersectionColor { get; set; }
Property Value
Type | Description |
---|---|
PdfColor | PdfColor specifies the intersection color of the 3D cross section. |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
IntersectionIsVisible
Gets or sets a value indicating whether the intersection of cutting plane with 3D artwork is visible.
Declaration
public bool IntersectionIsVisible { get; set; }
Property Value
Type |
---|
System.Boolean |
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page .
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page .
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
Opacity
Gets or sets the cutting plane opacity.
Declaration
public float Opacity { get; set; }
Property Value
Type |
---|
System.Single |
Remarks
The opacity is given in percents, 100 is full opacity, 0 is no opacity.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page.
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
Orientation
Gets or sets the orientation of the cutting plane.
Declaration
public object[] Orientation { get; set; }
Property Value
Type | Description |
---|---|
System.Object[] | A three-element array specifying the orientation of the cutting plane in world space, where each value represents the orientation in relation to the X, Y, and Z axes, respectively. |
Remarks
If the array has more than 3 elements, only the first 3 will be considered. Exactly one of the values must be null, indicating an initial state of the cutting plane that is perpendicular to the corresponding axis and clipping all geometry on the positive side of that axis. The other two values must be numbers indicating the rotation of the plane, in degrees, around their corresponding axes. The order in which these rotations are applied should match the order in which the values appear in the array.
Examples
//Create a new PDF document.
PdfDocument document = new PdfDocument();
//Create a new page.
PdfPage page = document.Pages.Add();
//Create a new Pdf3DAnnotation.
Pdf3DAnnotation annotation = new Pdf3DAnnotation(new RectangleF(10, 50, 300, 150), @"Input.u3d");
//Create a new Pdf3DCrossSection.
Pdf3DCrossSection crossSection = new Pdf3DCrossSection();
crossSection.Color = new PdfColor(Color.Blue);
crossSection.IntersectionIsVisible = true;
crossSection.IntersectionColor = new PdfColor(Color.Red);
crossSection.Opacity = 100;
//Create a new Pdf3DView.
Pdf3DView view = new Pdf3DView();
view.CameraToWorldMatrix = new float[] { -0.382684f, 0.92388f, -0.0000000766026f, 0.18024f, 0.0746579f, 0.980785f, 0.906127f, 0.37533f, -0.19509f, -100, -112.432f, 45.6829f };
view.CrossSections.Add(crossSection);
object[] orientation = crossSection.Orientation;
annotation.Views.Add(view);
page.Annotations.Add(annotation);
//Save the document to disk.
document.Save("Output.pdf");
//close the document.
document.Close(true);
'Create a new PDF document.
Dim document As New PdfDocument()
'Create a new page.
Dim page As PdfPage = document.Pages.Add()
'Create a new Pdf3DAnnotation.
Dim annotation As New Pdf3DAnnotation(New RectangleF(10, 50, 300, 150), "Input.u3d")
'Create a new Pdf3DCrossSection.
Dim crossSection As New Pdf3DCrossSection()
crossSection.Color = New PdfColor(Color.Blue)
crossSection.IntersectionIsVisible = True
crossSection.IntersectionColor = New PdfColor(Color.Red)
crossSection.Opacity = 100
'Create a new Pdf3DView.
Dim view As New Pdf3DView()
view.CameraToWorldMatrix = New Single() { -0.382684F, 0.92388F, -7.66026E-08F, 0.18024F, 0.0746579F, 0.980785F, 0.906127F, 0.37533F, -0.19509F, -100, -112.432F, 45.6829F}
view.CrossSections.Add(crossSection)
annotation.Views.Add(view)
object[] orientation = crossSection.Orientation
page.Annotations.Add(annotation)
'Save the document to disk.
document.Save("Output.pdf")
'close the document.
document.Close(True)
See Also
Methods
Initialize()
Initializes annotation object.
Declaration
protected virtual void Initialize()
Save()
Saves an annotation.
Declaration
protected virtual void Save()