CSailWorker Class Reference
[Sail computations library]

#include <sailworker.h>

Inheritance diagram for CSailWorker:

CSailDef

List of all members.

Public Member Functions

 CSailWorker (const CSailDef &s)
real Area ()
real Diagonal ()
real IRCwidth (const real &h)
real SailWidth (const real &h)
real LeechLength (const real &h)
real LuffLength (const real &h)
real SailLP ()
CPanelGroup makeSail () const
CPanelGroup makeSail (CPanelGroup &flatsail, CPanelGroup &dispsail) const

Public Attributes

CPoint3d tack
CPoint3d head
CPoint3d peak
CPoint3d clew

Protected Member Functions

CPanelGroup Layout0 (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPanelGroup LayoutTwist (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPanelGroup LayoutVertical (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPanelGroup LayoutRadial (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPanelGroup LayoutMitre (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPanelGroup LayoutMitre2 (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPanelGroup LayoutTriRadial (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPanelGroup LayoutWing (CPanelGroup &flatsail, CPanelGroup &dispsail) const
CPoint3d EdgeIntersect (const enumEdgeType &Edge, const CPoint3d &pt1, const CVector3d &v1) const
CPoint3d FwdIntersect (const CPoint3d &pt1) const
CPoint3d AftIntersect (const CPoint3d &pt1) const
CPoint3d MitreIntersect (const CPoint3d &pt1, const CVector3d &v1) const
CPoint3d Zpoint (const CPoint3d &p1) const
CPanel Zpanel (const CPanel &p1) const

Protected Attributes

enumEdgeType Edge
CPoint3d mitreLuffPt
CVector3d footV
CVector3d footVP
CVector3d gaffV
CVector3d gaffVP
CVector3d leechV
CVector3d leechVP
CVector3d luffV
CVector3d luffVP
CVector3d mitreV
CSubSpace footLine
CSubSpace gaffLine
CSubSpace leechLine
CSubSpace luffLine
CSubSpace mitreLine


Detailed Description

The CSailWorker class does all the sail-related calculations like laying the panels. It is used to create the sail from a CSailDef definition.

See also:
CSailDef, CPanelGroup

Definition at line 47 of file sailworker.h.


Constructor & Destructor Documentation

CSailWorker::CSailWorker ( const CSailDef s  ) 

The constructor does some preliminary calculations to set internal variables.

VC++ 6 pre-SP3 bug if we pass the result of a square root directly, see : MS knowledgebase 217164).

Define foot vector of sail edge.

Define gaff vector of sail edge.

Define fleech vector of sail edge.

Define luff vector of sail edge.

Define mitre vector bisecting foot-leech angle.

Define the unitary vectors perpendicular to foot edge, rotated anti-clockwise.

Define the unitary vectors perpendicular to gaff edge, rotated anti-clockwise.

Define the unitary vectors perpendicular to leech edge, rotated anti-clockwise.

Define the unitary vectors perpendicular to luff edge, rotated anti-clockwise.

Define useful straight lines of edges and mitre.

Define point at intersection of mitre and luff.

Definition at line 35 of file sailworker.cpp.

References clew, EdgeIntersect(), CSailDef::footL, footLine, footV, footVP, CSailDef::foreI, CSailDef::foreJ, CSailDef::gaffDeg, CSailDef::gaffL, gaffLine, gaffV, gaffVP, head, CSailDef::leechL, leechLine, leechV, leechVP, CSubSpace3d::line(), CSailDef::luffL, luffLine, luffV, luffVP, mitreLine, mitreLuffPt, mitreV, peak, CSailDef::rake, CMatrix::rot3d(), CSailDef::sailType, tack, CSailDef::tackX, CSailDef::tackY, CVector::unit(), CVector3d::x(), and CVector3d::y().


Member Function Documentation

real CSailWorker::Area (  ) 

The area of the sail.

Routine for computing the area of the sail taking into account the luff and leech round.

Author:
Robert Laine alias Sailcuter

Definition at line 3367 of file sailworker.cpp.

References CVector3d::cross(), CSailDef::footL, footV, CSailDef::gaffL, gaffV, CSailDef::leechL, leechV, CSailDef::luffL, CSailDef::luffR, luffV, and CVector::norm().

Referenced by CFormSailDef::compute().

real CSailWorker::Diagonal (  ) 

The head to clew diagonal length.

Routine for computing the diagonal length from head to clew.

Author:
Robert Laine alias Sailcuter

Definition at line 3382 of file sailworker.cpp.

References clew, and head.

Referenced by CFormSailDef::compute().

real CSailWorker::IRCwidth ( const real &  HL  ) 

The computation of the width as per IRC rule.

Routine for computing the width of the sail at a given relative height on the leech in accordance with IRC rule.

Author:
Robert Laine alias Sailcuter

compute the leech edge length LL

Definition at line 3394 of file sailworker.cpp.

References clew, EdgeIntersect(), LeechLength(), leechV, leechVP, luffVP, and Zpoint().

Referenced by CFormSailDef::slotCompute().

real CSailWorker::SailWidth ( const real &  HL  ) 

The computation of the sail width at any height.

Routine for computing the width of the sail at a given relative height on the luff and the leech.

Author:
Robert Laine alias Sailcuter

Definition at line 3448 of file sailworker.cpp.

References clew, EdgeIntersect(), LeechLength(), leechV, leechVP, LuffLength(), luffV, luffVP, tack, and Zpoint().

Referenced by CFormSailDef::slotCompute().

real CSailWorker::LeechLength ( const real &  h  ) 

The length of the leech measured along its curved edge.

Routine for computing the actual length of the leech edge up to a given relative heigth on straight leech line.

Author:
Robert Laine alias Sailcuter

Definition at line 3555 of file sailworker.cpp.

References clew, EdgeIntersect(), leechV, leechVP, and Zpoint().

Referenced by IRCwidth(), and SailWidth().

real CSailWorker::LuffLength ( const real &  h  ) 

The length of the luff measured along its curved edge.

Routine for computing the actual length of the luff edge up to a given relative heigth on straight luff line.

Author:
Robert Laine alias Sailcuter

Definition at line 3582 of file sailworker.cpp.

References EdgeIntersect(), luffV, luffVP, tack, and Zpoint().

Referenced by SailWidth().

real CSailWorker::SailLP (  ) 

The maximum width of the sail perpendicular to the luff.

Routine for computing the perpendicular width of the sail from clew to luff, measured perpendicular to the luff.

Author:
Robert Laine alias Sailcuter

Definition at line 3523 of file sailworker.cpp.

References clew, EdgeIntersect(), luffVP, CVector3d::z(), and Zpoint().

Referenced by CFormSailDef::slotCompute().

CPanelGroup CSailWorker::makeSail (  )  const

Make a Sail from its definition.

Definition at line 119 of file sailworker.cpp.

CPanelGroup CSailWorker::makeSail ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const

Make a Sail from its definition. This is the main routine of all the sail layout work The output is a 3D sail, its display and development versions.

Definition at line 131 of file sailworker.cpp.

References Layout0(), LayoutMitre(), LayoutMitre2(), LayoutRadial(), LayoutTwist(), LayoutVertical(), LayoutWing(), CPanelGroup::placeLabels(), CPanelGroup::plotLabels(), CSailDef::sailCut, CSailDef::sailID, CSailDef::sailType, and CPanelGroup::title.

CPanelGroup CSailWorker::Layout0 ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Cross cut and Horizontal cut layout of sail's panels.

Creates a Cross cut or horizontal cut sail.

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter

Lay the panels starting from the foot, going upward to the peak

Go over all the points of current panel and calculate their Z

Develop the current panel

Compute and store the deviation of top edge of the developed panel and straighten this top edge except if this is the top panel

Add the seam and hems allowance

Reposition the developed panel such that the lowest point is Y=0 AND most left point is X=0.

Loop FOR next panel

Create the displays version of the developed sail

Definition at line 192 of file sailworker.cpp.

References CPanelGroup::boundingRect(), clew, CSailDef::clothW, EdgeIntersect(), CSailDef::footHemW, footLine, gaffLine, CSubSpace::getdim(), CSubSpace::getp(), head, CRect3d::height(), CSailDef::hemsW, CSubSpace::intersect(), CSailDef::leechHemW, leechV, leechVP, CSubSpace3d::line(), luffLine, luffV, peak, CMatrix::rot3d(), CPanelGroup::rotate(), CSailDef::sailCut, CSailDef::seamW, tack, CVector::unit(), CVector3d::x(), CVector3d::y(), and Zpanel().

Referenced by makeSail().

CPanelGroup CSailWorker::LayoutTwist ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Twist cut layout of sail's panels.

Creates a twist foot cut sail.

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter

Start laying the panels from foot upward to the peak

Definition at line 564 of file sailworker.cpp.

References CPanelGroup::boundingRect(), clew, CSailDef::clothW, EdgeIntersect(), CSailDef::footHemW, footVP, gaffLine, CSubSpace::getdim(), CSubSpace::getp(), head, CRect3d::height(), CSailDef::hemsW, CSubSpace::intersect(), CSailDef::leechHemW, leechV, leechVP, CSubSpace3d::line(), luffLine, luffV, peak, CMatrix::rot3d(), CPanelGroup::rotate(), CSailDef::seamW, tack, CVector::unit(), CVector3d::x(), CVector3d::y(), and Zpanel().

Referenced by makeSail().

CPanelGroup CSailWorker::LayoutVertical ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Vertical cut layout of sail's panels.

Creates a VERTICAL cut sail.

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter

Lay the panels parallel to the leech, from the leech toward the tack

Definition at line 902 of file sailworker.cpp.

References CPanelGroup::boundingRect(), clew, CSailDef::clothW, EdgeIntersect(), CSailDef::footHemW, footLine, gaffLine, gaffV, head, CRect3d::height(), CSailDef::hemsW, CSailDef::leechHemW, leechV, leechVP, CSubSpace3d::line(), luffLine, peak, CMatrix::rot3d(), CSailDef::seamW, tack, CVector::unit(), CVector3d::x(), CVector3d::y(), and Zpanel().

Referenced by makeSail().

CPanelGroup CSailWorker::LayoutRadial ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Radial cut layout of sail's panels.

Creates a radial cut sail.

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter

Lay the panels from the top section downward to the foot section.

Definition at line 1524 of file sailworker.cpp.

References CPanelGroup::boundingRect(), clew, CSailDef::clothW, EdgeIntersect(), CSailDef::footHemW, footLine, footV, gaffLine, gaffV, gaffVP, CSubSpace::getp(), head, CRect3d::height(), CSailDef::hemsW, CSubSpace::intersect(), CSailDef::leechHemW, leechV, CSubSpace3d::line(), luffV, CRect3d::max, CSailDef::nbGores, CSailDef::nbLuffGores, CSailDef::nbSections, peak, CSailDef::seamW, tack, CVector3d::x(), CVector3d::y(), and Zpanel().

Referenced by makeSail().

CPanelGroup CSailWorker::LayoutMitre ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Mitre cut layout of sail's panels perpendicular to leech and foot.

Creates a mitre cut sail with panels perpendicular to Leech and Foot.

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter

Mitre Hem Width is set at twice the Seam Width.

First Cut the foot panels perpendicular to the foot, starting at the clew and moving toward the tack.

Then lay the leech panels perpendicular to the leech, starting from clew and moving upwards to the peak.

Definition at line 2485 of file sailworker.cpp.

References CPanelGroup::boundingRect(), clew, CSailDef::clothW, EdgeIntersect(), CSailDef::footHemW, footLine, footV, footVP, gaffLine, CSubSpace::getdim(), CSubSpace::getp(), head, CRect3d::height(), CSailDef::hemsW, CSubSpace::intersect(), CSailDef::leechHemW, leechV, leechVP, CSubSpace3d::line(), luffLine, luffV, MitreIntersect(), mitreLine, mitreLuffPt, mitreV, peak, CMatrix::rot3d(), CSailDef::seamW, tack, CVector::unit(), CVector3d::x(), CVector3d::y(), and Zpanel().

Referenced by makeSail().

CPanelGroup CSailWorker::LayoutMitre2 ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Mitre 2 cut layout of sail's panels parralel to foot and leech.

Creates a Mitre 2 cut sail with panels Parallel to Leech & Foot.

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter Adapted by Peter G. Meuse

Mitre Hem Width is set at twice the Seam Width.

Start by laying the foot panels parallel to the foot, from the foot upward toward the mitre

Then continue by laying the leech panels parallel to the leech, from the leech toward the luff intersection with the mitre.

Definition at line 2950 of file sailworker.cpp.

References CPanelGroup::boundingRect(), clew, CSailDef::clothW, EdgeIntersect(), CSailDef::footHemW, footV, footVP, gaffLine, gaffV, CSubSpace::getdim(), CSubSpace::getp(), head, CRect3d::height(), CSailDef::hemsW, CSubSpace::intersect(), CSailDef::leechHemW, leechV, leechVP, CSubSpace3d::line(), luffLine, MitreIntersect(), mitreLine, mitreLuffPt, mitreV, peak, CMatrix::rot3d(), CSailDef::seamW, tack, CVector::unit(), CVector3d::x(), CVector3d::y(), and Zpanel().

Referenced by makeSail().

CPanelGroup CSailWorker::LayoutTriRadial ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Tri Radial cut layout of sail's panels.

Creates a triradial cut sail. //// NOT USED ////

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter

Lay the panels from top section downward

Definition at line 2027 of file sailworker.cpp.

References CPanelGroup::boundingRect(), clew, CSailDef::clothW, EdgeIntersect(), footV, footVP, gaffLine, gaffV, gaffVP, CSubSpace::getp(), head, CRect3d::height(), CSailDef::hemsW, CSubSpace::intersect(), CSailDef::leechHemW, leechV, CSubSpace3d::line(), luffV, CRect3d::max, CSailDef::nbGores, CSailDef::nbSections, peak, CSailDef::seamW, tack, CVector3d::x(), CVector3d::y(), and Zpanel().

CPanelGroup CSailWorker::LayoutWing ( CPanelGroup flatsail,
CPanelGroup dispsail 
) const [protected]

The Wing cut layout of sail's panels.

Creates a WING with horizontal cut layout. The panels are layed parrallel to the central line of the wing (horizontal cut)

Parameters:
flatsail the CPanelGroup object that will hold the developed sail
dispsail the CPanelGroup object that will hold the display version of the developed sail
Returns:
CPanelGroup
Author:
Robert Laine alias Sailcuter

Position the seams starting from the centre of the wing (foot)

Create the symetrical panels

Prepare the displays version of the developed sail

Definition at line 1154 of file sailworker.cpp.

References clew, CSailDef::clothW, CSailDef::dihedralDeg, EdgeIntersect(), CSailDef::footHemW, footLine, gaffLine, CSubSpace::getdim(), CSubSpace::getp(), head, CSailDef::hemsW, CSubSpace::intersect(), CSailDef::leechHemW, leechV, leechVP, CSubSpace3d::line(), luffLine, luffV, peak, CMatrix::rot3d(), CPanelGroup::rotate(), CSailDef::seamW, tack, CVector::unit(), CVector3d::x(), CVector3d::y(), and Zpanel().

Referenced by makeSail().

CPoint3d CSailWorker::EdgeIntersect ( const enumEdgeType &  Edge,
const CPoint3d pt1,
const CVector3d v1 
) const [protected]

The intersection of a line defined by a point and a vector with an edge.

Routine used for computing the point position on a sail curved edge. Return a 3D point which is the intersection of the vector v1 passing by pt1 point inside sail area with the Edge curve.

Author:
Robert Laine alias Sailcuter

Definition at line 3649 of file sailworker.cpp.

References clew, CSubSpace::getdim(), CSubSpace::getp(), head, CSubSpace::intersect(), CSubSpace3d::line(), CSailDef::luffR, CSailDef::luffRP, CVector::norm(), peak, CMatrix::rot3d(), tack, and CVector::unit().

Referenced by AftIntersect(), CSailWorker(), FwdIntersect(), IRCwidth(), Layout0(), LayoutMitre(), LayoutMitre2(), LayoutRadial(), LayoutTriRadial(), LayoutTwist(), LayoutVertical(), LayoutWing(), LeechLength(), LuffLength(), SailLP(), and SailWidth().

CPoint3d CSailWorker::FwdIntersect ( const CPoint3d pt1  )  const [protected]

The horizontal intersection with forward edge.

Routine used for computing the forward end of the cord of the profile. Return a 3d point which is the forward intersection of the horizontal line passing by p1 with either foot, luff or gaff.

Author:
Robert Laine alias Sailcuter

Definition at line 3607 of file sailworker.cpp.

References EdgeIntersect(), head, peak, tack, CVector3d::x(), CVector3d::y(), and CVector3d::z().

Referenced by Zpoint().

CPoint3d CSailWorker::AftIntersect ( const CPoint3d pt1  )  const [protected]

The horizontal intersection with aft edge.

Routine used for computing the cord of the profiles. Return a 3d point which is the aft intersection of the horizontal line passing by p1 with the leech. If the point p1 is above or below the leech segment then the aft intersection is forced to be on the vertical of the corresponding peak or clew.

Author:
Robert Laine alias Sailcuter

Definition at line 3335 of file sailworker.cpp.

References clew, EdgeIntersect(), peak, CVector3d::x(), CVector3d::y(), and CVector3d::z().

Referenced by Zpoint().

CPoint3d CSailWorker::MitreIntersect ( const CPoint3d pt1,
const CVector3d v1 
) const [protected]

The intersection of a line defined by a point and a vector with the mitre line.

Routine used for computing the intersection with mitre line. Return a 3d point which is the intersection of the vector v1 passing by pt1 point with the mitre line.

Author:
: Robert Laine alias Sailcuter

Definition at line 3776 of file sailworker.cpp.

References clew, CSubSpace::getdim(), CSubSpace::getp(), CSubSpace::intersect(), CSubSpace3d::line(), mitreLine, and CVector::norm().

Referenced by LayoutMitre(), and LayoutMitre2().

CPoint3d CSailWorker::Zpoint ( const CPoint3d p1  )  const [protected]

The depth of the sail at a point.

Routine used for computing the Z of a point of the sail. Return a 3D point which is the input point p1 with its Z modified.

Author:
Robert Laine alias Sailcuter

Definition at line 3807 of file sailworker.cpp.

References AftIntersect(), clew, FwdIntersect(), head, CSailMould::interpol(), leechV, CSailDef::mould, peak, CSailDef::sheetDeg, tack, CSailDef::twistDeg, CVector3d::x(), CVector3d::y(), CVector3d::z(), and CProfile::z().

Referenced by IRCwidth(), LeechLength(), LuffLength(), SailLP(), SailWidth(), and Zpanel().

CPanel CSailWorker::Zpanel ( const CPanel p1  )  const [protected]

The depth of the sail at all points of a panel.

Routine used for computing the Z of all the points of a panel. Returns a CPanel with all its points Z's modified.

Author:
Robert Laine alias Sailcuter

Definition at line 3874 of file sailworker.cpp.

References CPanel::bottom, CPanel::left, CPanel::right, CPanel::top, and Zpoint().

Referenced by Layout0(), LayoutMitre(), LayoutMitre2(), LayoutRadial(), LayoutTriRadial(), LayoutTwist(), LayoutVertical(), and LayoutWing().


Member Data Documentation

enumEdgeType CSailWorker::Edge [protected]

The type of sail Edge for an intersection.

Definition at line 98 of file sailworker.h.

The mitre intersection point with luff.

Definition at line 109 of file sailworker.h.

Referenced by CSailWorker(), LayoutMitre(), and LayoutMitre2().

Foot vector.

Definition at line 117 of file sailworker.h.

Referenced by Area(), CSailWorker(), LayoutMitre(), LayoutMitre2(), LayoutRadial(), and LayoutTriRadial().

Unitary vector perpendicular to foot.

Definition at line 119 of file sailworker.h.

Referenced by CSailWorker(), LayoutMitre(), LayoutMitre2(), LayoutTriRadial(), and LayoutTwist().

Gaff vector.

Definition at line 121 of file sailworker.h.

Referenced by Area(), CSailWorker(), LayoutMitre2(), LayoutRadial(), LayoutTriRadial(), and LayoutVertical().

Unitary vector perpendicular to gaff.

Definition at line 123 of file sailworker.h.

Referenced by CSailWorker(), LayoutRadial(), and LayoutTriRadial().

Unitary vector perpendicular to leech.

Definition at line 127 of file sailworker.h.

Referenced by CSailWorker(), IRCwidth(), Layout0(), LayoutMitre(), LayoutMitre2(), LayoutTwist(), LayoutVertical(), LayoutWing(), LeechLength(), and SailWidth().

Unitary vector perpendicular to luff.

Definition at line 131 of file sailworker.h.

Referenced by CSailWorker(), IRCwidth(), LuffLength(), SailLP(), and SailWidth().

Mitre vector.

Definition at line 133 of file sailworker.h.

Referenced by CSailWorker(), LayoutMitre(), and LayoutMitre2().

The foot straight 3D line.

Definition at line 136 of file sailworker.h.

Referenced by CSailWorker(), Layout0(), LayoutMitre(), LayoutRadial(), LayoutVertical(), and LayoutWing().

The gaff straight 3D line.

Definition at line 138 of file sailworker.h.

Referenced by CSailWorker(), Layout0(), LayoutMitre(), LayoutMitre2(), LayoutRadial(), LayoutTriRadial(), LayoutTwist(), LayoutVertical(), and LayoutWing().

The leech straight 3D line.

Definition at line 140 of file sailworker.h.

Referenced by CSailWorker().

The luff straight 3D line.

Definition at line 142 of file sailworker.h.

Referenced by CSailWorker(), Layout0(), LayoutMitre(), LayoutMitre2(), LayoutTwist(), LayoutVertical(), and LayoutWing().

The mitre straight 3D line.

Definition at line 144 of file sailworker.h.

Referenced by CSailWorker(), LayoutMitre(), LayoutMitre2(), and MitreIntersect().


The documentation for this class was generated from the following files:

Generated on Sun Mar 22 21:38:32 2009 for Sailcut CAD by  doxygen 1.5.6