Skip to content

Mismatch between projected point and parameter in ShapeAnalysis_Curve::Project #345

Open
@arjan-schouten

Description

@arjan-schouten

Description

In this case a point is projected on a wire and the returned projected point is different then the point the returned parameter yields.

Debugging yields that the correct projection and parameter are found in a first attempt. It then tries to find a better solution but it doesn't find one where the distance is less then the first found. It now restores the first found distance and parameter but doesn't restore the first projected point.

See below code

if (distmin > aModMin)
{
distmin = aModMin;
param = aModParam;
}
return distmin;

Expected Behavior

The returned projection and parameter match.

Actual Behavior

The returned projection and parameter mismatch.

Sample Code or DRAW Tcl Script

	
        BRep_Builder b;
	TopoDS_Shape s;
	BRepTools::Read(s, "c:/temp/wire.brep", b);
	TopoDS_Wire w = TopoDS::Wire(s);

	gp_Pnt pnt(-5.9620395625172007, 188.32957914975418, 232.57973165696146);

	BRepAdaptor_CompCurve CC(w);

	double u;
	gp_Pnt proj1;
	gp_Pnt proj2;
	ShapeAnalysis_Curve SAC;
	double dist = SAC.Project(CC, pnt, Precision::Confusion(), proj1, u);

	proj1 = proj1;		 // { coord = { x = -1.9750867608081535e-13 y = 191.32747039960771 z = 218.59562912027135 } }
	proj2 = CC.Value(u); // { coord = { x = -4.8094037238747411 y = 191.50444073117907 z = 218.44060528320776 } }

Operating System

Windows

Compiler

MSVC

Bitness

64-bit

OCCT Version

latest

Additional Files

No response

Metadata

Metadata

Assignees

Labels

1. ModelingBoolean operations, offsets, primitives, any conversion, brep builders and etc...2. BugSomething isn't working

Type

Projects

  • Status

    Todo

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions