Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
arjan-schouten opened this issue Feb 5, 2025 · 3 comments
Assignees
Labels
1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... 2. Bug Something isn't working
Milestone

Comments

@arjan-schouten
Copy link

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

@arjan-schouten arjan-schouten added 0. New The issue was created, but not updated by maintainer. Waiting for updates labels and categories 2. Bug Something isn't working labels Feb 5, 2025
@arjan-schouten
Copy link
Author

I don't seem to be able to add the brep file that reproduces the problem. It says that .brep is not allowed.

@arjan-schouten
Copy link
Author

wire.zip

@dpasukhi dpasukhi added the 1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... label Feb 5, 2025
@dpasukhi dpasukhi self-assigned this Feb 5, 2025
@dpasukhi dpasukhi added this to the Release 8.0 milestone Feb 5, 2025
@dpasukhi dpasukhi removed the 0. New The issue was created, but not updated by maintainer. Waiting for updates labels and categories label Feb 5, 2025
@dpasukhi
Copy link
Member

dpasukhi commented Feb 5, 2025

Thank you for the detailed report!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1. Modeling Boolean operations, offsets, primitives, any conversion, brep builders and etc... 2. Bug Something isn't working
Projects
Status: Todo
Development

No branches or pull requests

2 participants