diff --git a/src/Mod/PartDesign/App/FeaturePipe.cpp b/src/Mod/PartDesign/App/FeaturePipe.cpp index ac8b071b97..126fff5d9b 100644 --- a/src/Mod/PartDesign/App/FeaturePipe.cpp +++ b/src/Mod/PartDesign/App/FeaturePipe.cpp @@ -73,7 +73,7 @@ using namespace PartDesign; const char* Pipe::TypeEnums[] = {"FullPath","UpToFace",NULL}; const char* Pipe::TransitionEnums[] = {"Transformed","Right corner", "Round corner",NULL}; -const char* Pipe::ModeEnums[] = {"Standard", "Fixed", "Frenet", "Auxillery", "Binormal", NULL}; +const char* Pipe::ModeEnums[] = {"Standard", "Fixed", "Frenet", "Auxiliary", "Binormal", NULL}; const char* Pipe::TransformEnums[] = {"Constant", "Multisection", "Linear", "S-shape", "Interpolation", NULL}; @@ -112,7 +112,6 @@ short Pipe::mustExecute() const App::DocumentObjectExecReturn *Pipe::execute(void) { - std::vector wires; try { wires = getProfileWires(); @@ -126,12 +125,12 @@ App::DocumentObjectExecReturn *Pipe::execute(void) else { //TODO: currently we only allow planar faces. the reason for this is that with other faces in front, we could //not use the current simulate approach and build the start and end face from the wires. As the shell - //beginns always at the spine and not the profile, the sketchshape cannot be used directly as front face. - //We would need a method to translate the frontshape to match the shell starting position somehow... + //begins always at the spine and not the profile, the sketchshape cannot be used directly as front face. + //We would need a method to translate the front shape to match the shell starting position somehow... TopoDS_Face face = TopoDS::Face(sketchshape); BRepAdaptor_Surface adapt(face); if(adapt.GetType() != GeomAbs_Plane) - return new App::DocumentObjectExecReturn("Pipe: Only planar faces supportet"); + return new App::DocumentObjectExecReturn("Pipe: Only planar faces supported"); } // if the Base property has a valid shape, fuse the pipe into it @@ -153,25 +152,27 @@ App::DocumentObjectExecReturn *Pipe::execute(void) App::DocumentObject* spine = Spine.getValue(); if (!(spine && spine->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))) return new App::DocumentObjectExecReturn("No spine linked."); + std::vector subedge = Spine.getSubValues(); TopoDS_Shape path; const Part::TopoShape& shape = static_cast(spine)->Shape.getValue(); buildPipePath(shape, subedge, path); path.Move(invObjLoc); - - + + + // auxiliary TopoDS_Shape auxpath; if(Mode.getValue()==3) { App::DocumentObject* auxspine = AuxillerySpine.getValue(); if (!(auxspine && auxspine->getTypeId().isDerivedFrom(Part::Feature::getClassTypeId()))) return new App::DocumentObjectExecReturn("No auxillery spine linked."); std::vector auxsubedge = AuxillerySpine.getSubValues(); - TopoDS_Shape path; + const Part::TopoShape& auxshape = static_cast(auxspine)->Shape.getValue(); buildPipePath(auxshape, auxsubedge, auxpath); auxpath.Move(invObjLoc); - } - + } + //build up multisections auto multisections = Sections.getValues(); std::vector> wiresections; @@ -193,15 +194,15 @@ App::DocumentObjectExecReturn *Pipe::execute(void) TopExp_Explorer ex; size_t i=0; for (ex.Init(static_cast(obj)->Shape.getValue(), TopAbs_WIRE); ex.More(); ex.Next()) { - wiresections[i].push_back(TopoDS::Wire(ex.Current())); if(i>=wiresections.size()) return new App::DocumentObjectExecReturn("Multisections need to have the same amount of inner wires as the base section"); - + wiresections[i].push_back(TopoDS::Wire(ex.Current())); + ++i; } + if(i::const_iterator it = subedge.begin(); it != subedge.end(); ++it) { TopoDS_Shape subshape = shape.getSubShape(it->c_str()); @@ -486,5 +487,3 @@ PROPERTY_SOURCE(PartDesign::SubtractivePipe, PartDesign::Pipe) SubtractivePipe::SubtractivePipe() { addSubType = Subtractive; } - -