Creating a Chined Hull Vessel

Often the hardest part of creating a design is to find a suitable starting point. This example file modifies a parent hull to fit specified parameters, allowing a vessel to be quickly transformed into a variety of different parameter hulls.

 

The sample file uses a very simple three surface planing hull and allows the user to specify various parameters for the hull as shown in the screen shot below.

Resources

The Excel Workbook containing this file is stored in C:\Program Files\Maxsurf\Automation Samples\Maxsurf\Chined Hull Example.xls. The file uses the Maxsurf design “Chined Hull Example.msd” in that same folder.

Figure 20 Chined Hull Example Spreadsheet. The sheet contains parameters for the hull and macro buttons to execute changes.

If a designer designs a large number of vessels of a similar style, then a program like this could be developed to create a hull from the correct initial parameters. The hull form will be mostly faired already and will save a lot of the initial design time.

 

The procedures executed by the command buttons are separated into several small procedures. Each procedure moves a specific set of control points, such as the inboard chine control points or the deck edge, topside surface control points. As each procedure is somewhat dependant on other procedures, some procedures are run more than once.

 

For example, scaling the length of the vessel changes the stem angle, but changing the stem angle will change the vessel length, so the processes must be run more than once to ensure each ends up with the correct values.

 

The code for this procedure is quite lengthy and won’t be included in full. The following code segment has been included, showing the procedure for setting the chine to the correct height and beam locations. This code moves three separate sets of control points.

§   The Inboard set of Chine Surface Control Points

§   The Outboard/Upper set of Bottom surface control points

§   The Bottom surface control points defining the rise of keel up to the chine line at the bow.

 

Note that the use of a surface list to access the surface control points and the use of arrays for storing rows of control points

 

Sub SetChineHeightandBottomWidth()

 

Dim sList As New Maxsurf.SurfaceList

sList.Add msApp.Design.Surfaces

 

Dim CPx(9) As Double

Dim CPy(9) As Double

Dim CPz(9) As Double

 

Dim ChineHeight As Double

Dim MoveDistZ As Double

Dim BottomWidth As Double

Dim ScaleY As Double

Dim ChineAtBow As Double

Dim ScaleZ As Double

 

 

ChineHeight = Range("C6")

If ChineHeight < 0.05 Then

    ChineHeight = 0.05

    Range("C6") = ChineHeight

End If

 

BottomWidth = Range("C8")

If BottomWidth < 0.05 Then

    BottomWidth = 0.05

    Range("C8") = BottomWidth

End If

 

'Set the ChineHeight and Bottom Width

For m = 1 To 9

    sList(3).GetControlPoint 1, m, CPx(m), CPy(m), CPz(m)

Next

 

ScaleY = BottomWidth / CPy(1)

MoveDistZ = ChineHeight - CPz(1)

 

For m = 1 To 9

    'Chine Surface Inboard CPs

    sList(3).SetControlPoint 1, m, CPx(m), CPy(m) * ScaleY, CPz(m) + MoveDistZ

    'Bottom Surface Outer/Upper CPs

    sList(2).SetControlPoint 1, m, CPx(m), CPy(m) * ScaleY, CPz(m) + MoveDistZ

Next

 

'Scale the keel line curve between zero and the forward chine point

ChineAtBow = CPz(9)

For m = 1 To 9

    'Bottom keel line CPs

    sList(2).GetControlPoint 2, m, CPx(m), CPy(m), CPz(m)

Next

ScaleZ = 0.5 * ChineAtBow / CPz(9)

 

For m = 1 To 9

    sList(2).SetControlPoint 2, m, CPx(m), CPy(m), CPz(m) * ScaleZ

Next

 

msApp.Refresh

 

End Sub

None of the procedures in this example file allow input variables, such as the bottom width, of zero. If the bottom width was set to zero, all the y coordinates for the chine and outer bottom edge would sit on the vessel centre line. If we then tried to make the vessel wider by scaling the control points outwards, all the control points would remain in a straight line. By keeping the bottom width slightly above zero, we maintain the curved shape (even if it is extremely flat) in the hull and can therefore reverse any process performed, returning the bottom width out to its previous size.

 

To see the remained of the code in this example file, view it through the VBA editor in Excel.