Loft

Technical discussions
Post Reply
John M
Posts: 6
Joined: Fri Sep 25, 2015 6:50 am

Loft

Post by John M »

Hello

I need a little specialised Loft command. I wonder if it is available in v6.1? I use it when available as it's the perfect way to build a fan or propeller blade. I have several CAD programs and only a couple offer the Loft command.

Regards

John

nickz
Site Admin
Posts: 236
Joined: Fri Jul 26, 2013 3:58 am

Re: Loft

Post by nickz »

Hi John

IWireArrayToSurfaceBuilder_DG interface implements the loft.
It is calls into Open Cascade's BRepOffsetAPI_ThruSections class
https://old.opencascade.com/doc/occt-6. ... tions.html
This is what is used inside.

Thank you for pointing it out. We have added this to the interface page in docs.

It is demonstrated in Surfaces sample. The main code (C#) is in

private void CreateSurface(bool bRuled, bool bCircleBase, bool solid)
{
IBRepWire_DG wire1, wire2, wire3, wire4;
// Create wire circles
if( bCircleBase )
{
// Create wire circles
VectDg zAxis = new VectDg(0, 0, 1);
wire1 = CreateWireCircle(new PointDg(100, 0, -100), zAxis, 40);
wire2 = CreateWireCircle(new PointDg(210, 0, 0), zAxis, 40);
wire3 = CreateWireCircle(new PointDg(275, 0, 100), zAxis, 40);
wire4 = CreateWireCircle(new PointDg(200, 0, 200), zAxis, 40);
}
else
{
wire1 = CreateWireSpline(100.0, 0.0, -100.0);
wire2 = CreateWireSpline(210.0, 0.0, -0.0);
wire3 = CreateWireSpline(275.0, 0.0, 100.0);
wire4 = CreateWireSpline(200.0, 0.0, 200.0);
}

IWireArrayToSurfaceBuilder_DG iThruSections = (IWireArrayToSurfaceBuilder_DG)m_iGener.Create("WireArrayToSurfaceBuilder_DG");

// Remove the current object
RemoveAllObjects();

iThruSections.Init(rbRuled.Checked ? true : false, 1e-6); // Solid, ruled, precision
iThruSections.AddWire(wire1);
iThruSections.AddWire(wire2);
iThruSections.AddWire(wire3);
iThruSections.AddWire(wire4);

IBRepShape_DG shape = iThruSections.Build(solid);

// Add shape to the displayed model
m_iModel.AddBRepShape(shape);

// Fit into the window
IView_DG iView = m_kernCAD.GetView() as IView_DG;
iView.Reset(true, false);
// Zoom out
iView.Zoom(0.5);
m_kernCAD.UpdateView();
}

It creates an array of the cross-section profiles (either circles or open bspline curves depending on bCircleBase parameter) and calls Build(). You can see it running in the sample explorer first.

Regards
Nick

John M
Posts: 6
Joined: Fri Sep 25, 2015 6:50 am

Re: Loft

Post by John M »

Thank you, Nick
I'm now rewriting two old programs I have. I should have lots of options to show off the Loft command.
Regards
John

Post Reply