New NURBS tools

User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: New NURBS tools

Post by clintonman »

trueBlue wrote: 15 Jan 2021, 21:34
clintonman wrote: 15 Jan 2021, 21:27
trueBlue wrote: 15 Jan 2021, 21:25
Add NURBS cube
Press the Edit button in the Stack/Panels - controlPointMesh
Add
Primitive to the controlPointMesh or near by somewhere
I still got nothing, I may be a version or 2 behind. I'll check my other tS installation.
Edit: nope, still nothing

Edit: wait a sec I missed a step
Edit: nope, still nothing
Edit: I reloaded this uploaded object and it is invisible
Removed it
Edit2: You can do the same when PE a mesh and add primitives to the object's Editable Mesh
I suppose it would not be any different then adding primitives to the controlPointMesh
PEwithPrimitives.png
Ah, ok, I misunderstood. I thought you meant add a nurbs primitive to the control point mesh.
So, doesn't that mean it's just another tool that needs the RestrictNURBS?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: New NURBS tools

Post by trueBlue »

clintonman wrote: 15 Jan 2021, 22:14
trueBlue wrote: 15 Jan 2021, 21:34
clintonman wrote: 15 Jan 2021, 21:27
I still got nothing, I may be a version or 2 behind. I'll check my other tS installation.
Edit: nope, still nothing

Edit: wait a sec I missed a step
Edit: nope, still nothing
Edit: I reloaded this uploaded object and it is invisible
Removed it
Edit2: You can do the same when PE a mesh and add primitives to the object's Editable Mesh
I suppose it would not be any different then adding primitives to the controlPointMesh
PEwithPrimitives.png
Ah, ok, I misunderstood. I thought you meant add a nurbs primitive to the control point mesh.
So, doesn't that mean it's just another tool that needs the RestrictNURBS?
I doubt you can do anything with tS's primitive tool because it is a widget
How would you know that the controlPointMesh is in PE mode?
And if so, how could you stop it?
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: New NURBS tools

Post by trueBlue »

I found an easier way for fixing the unsupported Workspace tool's toolbar button Command
Example for + SDS button Command

Code: Select all

ScriptObject.Execute("Scripts/Commands/DeSelectNURBS");MeshModifiers.ChangeSSLevel(1)
It is easier because all I have to do is add the first part to the beginning of the Command
I bet you could even come up with a script that does that for me :idea: :mrgreen:

The DeSelectNURBS xml file/script

Code: Select all

function Execute(params)
{
	// validate to avoid tS script selection bug
	if(!IsValidSelection(Node.Selection())) {
		return;
	}

	for (var i=0; i<Node.SelectedCount(); i++) {
		var Sel = Node.Selected(i);

		if(IsNURBS(Sel)) {

if(!Node.Exists("/Status Message")) return;
Node.Value("/Status Message", "Seconds") = 2000 
Node.Value("/Status Message", "Message") = " NURBS are not supported ... Select a 3D Object"
Activity.Run("/Status Message/Status Message")
Space.Unselect()

		return;
		}
	}

}

function IsValidSelection(selection)
{
	if(!selection) return false;

	var reWhiteSpace = /^\s/; // whitespace in first character position for cleaning selection text

	var selectionArray = selection.split(";");

	for(var i = 0; i < selectionArray.length; i++) {
		var selClean = selectionArray[i].replace(reWhiteSpace, "");

		if(!Node.Exists(selClean)) {
			return false;
		}
	}

	return true;
}

function IsNURBS(curNode)
{
	var nurbsNode = curNode;

	if(Node.ConExists(curNode, "Matrix"))
		nurbsNode = Node.Owner(curNode);

	if(Node.ConExists(nurbsNode, "isaCurve")) {
		return true;
	}

	if(Node.Exists(nurbsNode + "/CP to patch CP")) {
		return true;
	}

	return false

}
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: New NURBS tools

Post by clintonman »

Glad you found a solution.

Why Space.Unselect() at the end?
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: New NURBS tools

Post by trueBlue »

clintonman wrote: 15 Jan 2021, 23:10 Glad you found a solution.

Why Space.Unselect() at the end?
Gives the user a visual that it was unselected (baa bye object widget :bananahi: ) and it did not work!
Does not happen on a support object
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: New NURBS tools

Post by trueBlue »

Why is this twisted in the middle of the swept path?
Note: I did use Align Distribute on both objects.
Twisted swept Path.png
Twisted swept Path.png (2.74 KiB) Viewed 2298 times
Also I discovered an issue with the Insert Control Point on a normal 3D object in PE mode
Insert CP on mesh issue.png
Insert CP on mesh issue.png (8.84 KiB) Viewed 2293 times
Attachments
Sweep Path, 1.RsScn
(1.06 MiB) Downloaded 143 times
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: New NURBS tools

Post by clintonman »

trueBlue wrote: 16 Jan 2021, 21:27 Why is this twisted in the middle of the swept path?
Note: I did use Align Distribute on both objects.
Twisted swept Path.png
Also I discovered an issue with the Insert Control Point on a normal 3D object in PE mode
Insert CP on mesh issue.png
Most likely has to do with the way tS handles angles. It's limited to plus or minus 180 degrees and in the Y direction I think it's more like 90 degrees. When it passes those limits all the angles change and you can get twisting. It can probably be fixed by bypassing all tS math and rolling your own math from scratch, but I won't be the one to do that.
So don't insert control point in normal mesh. Like the old joke, "Doctor it hurts when I do this". Doctor, "So don't do that"
Clinton Reese

http://clintons3d.com
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: New NURBS tools

Post by trueBlue »

clintonman wrote: 16 Jan 2021, 22:28 So don't insert control point in normal mesh. Like the old joke, "Doctor it hurts when I do this". Doctor, "So don't do that"
Easy enough fix Dr. Watson :ugeek:
insertControlPointScript
deleteControlPointScript
extendCurveScript

Code: Select all

if(!Node.ConExists(firstsel,"isaCurve")) 
{
System.Alert("Select a Curve");
params.SetTerminationFlag();
return;
}

Just got done finishing fixing your Quad toolbar/Modeling - Curve icons
They have old commands
Curve tools icons wrong commands.png
Curve tools icons wrong commands.png (43.48 KiB) Viewed 2287 times
Attachments
Q_PEModelingToolbar.RsObj
(232.19 KiB) Downloaded 128 times
User avatar
trueBlue
Captain
Posts: 5208
Joined: 06 Jul 2009, 22:50
Type the number ten into the box: 10

Re: New NURBS tools

Post by trueBlue »

How do you Freeze a Patch in Quads?
I have tried checking/unchecking Double Sided, but I am not seeing any differences
User avatar
clintonman
Captain
Posts: 5422
Joined: 21 May 2009, 21:08
Type the number ten into the box: 0
Location: California
Contact:

Re: New NURBS tools

Post by clintonman »

trueBlue wrote: 28 Jan 2021, 11:46 How do you Freeze a Patch in Quads?
I have tried checking/unchecking Double Sided, but I am not seeing any differences
It looks like it's a problem with some of the primitives. Quads won't come from sphere or cylinder. Works for plane, box, torus and it works for the cone if the top radius is not zero.
Clinton Reese

http://clintons3d.com
Post Reply