Fixing long splines rendering#367
Open
renato-grottesi wants to merge 12 commits intoCauldronDevelopmentLLC:masterfrom
Open
Fixing long splines rendering#367renato-grottesi wants to merge 12 commits intoCauldronDevelopmentLLC:masterfrom
renato-grottesi wants to merge 12 commits intoCauldronDevelopmentLLC:masterfrom
Conversation
The change allows correct rendering of quadratic and cubic splines with more than 4 control points by splitting the spline into segments and evaluating each segment as a quadratic or cubic spline, one at a time.
Member
|
This is looking good. exports.insert("SPLINE_CLOSED", 1 << 0);
exports.insert("SPLINE_PERIODIC", 1 << 1);
exports.insert("SPLINE_RATIONAL", 1 << 2);
exports.insert("SPLINE_PLANAR", 1 << 3);
exports.insert("SPLINE_LINEAR", 1 << 4); |
jcoffland
reviewed
May 26, 2022
tpl_lib/dxf/dxf.tpl
Outdated
| var degree = spl.degree; | ||
| var points = spl.ctrlPts; | ||
| var knots = spl.knots; | ||
| var weights = []; /* spl.weights; */ for(i=0; i<points.length; i++) { weights.push(1.0); } /* TODO */ |
Member
There was a problem hiding this comment.
The weights are in the DL_ControlPointData structure. The function Reader::addControlPoint()should passctrlPt.wto theaddControlPoint()callback. The weights could then be added tostd::vector DXF::Spline::weightsand then later passed viaDXFModule`` to TPL.
jcoffland
reviewed
May 26, 2022
tpl_lib/dxf/dxf.tpl
Outdated
| } | ||
| var steps = Math.ceil(nurbs_length(s) / res); | ||
| //var delta = 1.0 / steps; | ||
| var delta = 0.01; |
Member
There was a problem hiding this comment.
Why not use the value from nurbs_length() here?
Author
There was a problem hiding this comment.
because of the bug you found at line 238 :-D
sorry for pushing in a rush, but that was it for my 30 minutes of coding.
I have one free hour now, I'll address all comments and try to implement closed curves at least.
jcoffland
reviewed
May 26, 2022
tpl_lib/dxf/dxf.tpl
Outdated
|
|
||
| for (var i = 1; i <= 100; i++) { | ||
| var u = cubic_bezier(p, 0.01 * i); | ||
| var u = nurbs_interpolate(0.0*i, spl); |
Implemented and tested
Open
cf9d046 to
e2af4b4
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The change allows correct rendering of quadratic and cubic splines
with more than 4 control points by splitting the spline into
segments and evaluating each segment as a quadratic or cubic
spline, one at a time.