I’m developing a script for Rhinoceros.
I’m trying to do an Adjustable Blend Curve through the CRhinoDoc.RunScript (_BlendCrv) and passing the points to be connected. The command works properly only if the points that I pass to be joined are “in view”. Let me explain, I have to fillet a sole and a portion of this (which I previously cut) with the heel. It works if zoom includes the points that I pass, if there are outside the “range” of the zoom, I get a square for the selection from the selected point, with the result that I have to get out of the selection and click on the selected curve to blend the curve. Do you have any idea on how to fix or bypass this?
I am using C + + and the SDK 5.0.
Thanks in advance,
It is better to avoid using scripted commands when possible inside your plugin because it can sometime be a view or UI dependent.
For example, if you need to fillet an edge, then there is “FilletEdges”. It will help if you can provide an example of what you have and what you need to achive with a sample code to be able to assist you. Check the SDK utility functions.
thank you for your response.
In my code i have to blend two curves.
I have one curve that represent the sole of the shoe, cutted in two point chosed by the user. This curve have to be blend with the codetta ( the heel ). I have to give to the user the possibility to blend the curve at his pleasure ( like the Adjustable Blend Curve command , with the dialog and the option ).
This is an example ( is not the real code, but is similar )
ON_NurbsCurve* curveSoleCutted; // This is the curve that i have cut before
ON_NurbsCurve* curveCodetta; // This is the the curve that represent the codettta
// I already have the two curves , this is not the declaration
ON_3dPoint pointToJoinSole_1 = curveSoleCutted->PointAtStart();
ON_3dPoint pointToJoinSole_2 = curveSoleCutted->PointAtEnd();
ON_3dPoint pointCodetta_1 = curveCodetta->PointAtStart();
ON_3dPoint pointCodetta_2 = curveCodetta->PointAtEnd();
cmd.Format(_T("_BlendCrv %lf,%lf,%lf _Pause %lf,%lf,%lf"), pointToJoinSole_1 , pointCodetta_1 ); // Take for good that this 2 point are upper on their curves
cmd.Format(_T("_BlendCrv %lf,%lf,%lf _Pause %lf,%lf,%lf"), pointToJoinSole_2 , pointCodetta_2 ); // Take for good that this 2 point are lower on their curves
This is roughly what I do. What I need is a procedure similar to the _BlendCrv command that give at the user the same choice that _BlendCrv give ( the curvature, the possibility to move the point, truncation, join etc)
My apologies, but I do not understand your sample code. Can you post some sample geometry? Please provide what you have before you run BlendCrv and also what you get after you run BlendCrv.
BlendCrv is not a command that is easily script, as it is dependent on where pick on the curves. You can not script picking, only selection.
I make some screenshot to make you understand my problem.
I have a black curve that represent the sole that i have previously cut and a blue curve that represent the tang.
These curves are ON_NurbsCurve.
Then I move the tang in such a way that the axis of the sole is aligned with that of the tang
So we have 4 point that i previously calculated.
These point are ON_3dPoint and P1 must be blend with P3 and P2 with P4.
So I run the script _BlendCrv:
cmd.Format(_T("_BlendCrv %f%f%f _Pause %f%f%f"), P1.x , P1.y, P1,z , P3,x, P3.y, P3.z);
If the zoom doesn’t includes the points that i pass in runscript the result is a square selection.
If the zoom includes the points the command run perfectly:
I hope that this make my problem more clearly.
Thanks for the screen shots. But I would really like to see a 3dm file with the “before” and “after” geometry.
I’m sorry Dale but i do not understand your request.
Do you want a .3dm file without any working and a file with all working done, _BlendCrv includes?
Scusa l’intromissione, Marco
…e spero di non equivocare.
Ma credo che Dale desideri un file 3dm con le curve su cui vuoi usare il blend
piu’ un altro file 3dm con le stesse curve con aggiunta la curva di blend che vuoi ottenere dallo script.
Naturalmente la curva di blend la fai tramite comando senza usare script, solo per mostare cosa ti serve…
provvederò a farglieli avere