DiscussionsIssue archiveOCCT:Modeling Algorithms

Archived issue #0032371

Modeling Algorithms - Unnecessary range of iteration loop in an algorithm

CommunityOCCT:Modeling Algorithmsresolved1 public note

Search issues

Description

In file src/BRepLib/BRepLib.cxx, line 411:
for (ii = 0 ; ii < 3 ; ii++ ) {
should be changed to
for (ii = 1 ; ii < 3 ; ii++ ) {
Since ii == 0 always results in obtaining a null pointer Curve2dPtr after calling the first line BRep_Tool::CurveOnSurface (this function expects ii >= 1):

void  BRep_Tool::CurveOnSurface(const TopoDS_Edge& E, 
                                Handle(Geom2d_Curve)& C, 
                                Handle(Geom_Surface)& S, 
                                TopLoc_Location& L,
                                Standard_Real& First,
                                Standard_Real& Last,
                                const Standard_Integer Index)
{
  if (Index < 1)
    return;

Steps to reproduce

,,

Public activity

1 archived note

Participants are labeled by their role within this record.

01Commenter 1