Skip to content
This repository has been archived by the owner on Dec 18, 2018. It is now read-only.

Improve Node Blocks #600

Merged
merged 24 commits into from
Feb 16, 2018
Merged

Improve Node Blocks #600

merged 24 commits into from
Feb 16, 2018

Conversation

tpjnorton
Copy link
Collaborator

address #586.

@tpjnorton tpjnorton self-assigned this Feb 7, 2018
@tpjnorton tpjnorton added this to the R2018a.rev1 milestone Feb 7, 2018
@omichel
Copy link
Member

omichel commented Feb 12, 2018

I am not sure about the [list of strings], [any string], [lookup table] as it seems redundant with the MFString, SFString and lookupTable information present on the same line... I would simply make no comment in these cases.

@stefaniapedrazzi
Copy link
Member

stefaniapedrazzi commented Feb 12, 2018

Also note that a PROTO is a node and we would like that there is no difference between basic nodes and PROTO nodes for users, so I do not think it is good to specify it with [node, PROTO].

@tpjnorton
Copy link
Collaborator Author

My reason for using the [node, PROTO] notation is primarily that other fields can admit either one specific node, or any PROTO instance based on that node - the material field of a Shape node can admit either a Material node or any Material-based PROTO.

I think it's important to put PROTOs at the forefront as they're powerful and actually very useful. I wonder whether more people would take the time to learn and use them if we highlight them more like this.

@stefaniapedrazzi
Copy link
Member

stefaniapedrazzi commented Feb 12, 2018

But they are all nodes.
A Material node is a node and a PROTO based on Material is a node.
It is good to specify which specific kind of nodes can be inserted. But to me it is useless and confusing to not treat PROTO as nodes but to specify them in a string like [node, PROTO].

If we want to have a user-friendly and easy-to-use interface a users should not care if he is using a PROTO or a node. For him in the scene tree they should look exactly the same..
Moreover only advanced users will ever create PROTO nodes and need to really know the difference.

But we can better discuss this during the meeting.

MFString frontUrl [ ] # [list of strings]
MFString leftUrl [ ] # [list of strings]
MFString rightUrl [ ] # [list of strings]
MFString topUrl [ ] # [list of strings]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case, I believe we might be more precise, like: # [list of image URLs]

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sounds good to me!

@tpjnorton
Copy link
Collaborator Author

I've fixed a couple of latent problems with the doc css here too.

@tpjnorton
Copy link
Collaborator Author

👍

MFString leftUrl [ ] # [list of Image URLs]
MFString rightUrl [ ] # [list of Image URLs]
MFString topUrl [ ] # [list of Image URLs]
MFColor skyColor [ 0 0 0 ] # [0,1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing space after coma.

SFBool xAxis TRUE # [TRUE, FALSE]
SFBool yAxis TRUE # [TRUE, FALSE]
SFBool zAxis TRUE # [TRUE, FALSE]
SFFloat resolution -1 # [-1, [0, inf]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woow, that's not obvious to understand... Maybe we should use the standard mathematical representation for sets and intervals, which would translate into: { -1, [0, inf) }. If we use this scientific formalism, which I believe is good, we should also change all the [TRUE, FALSE] to {TRUE, FALSE} and [0, inf] to [0, inf), [ImageTexture, PROTO] to {ImageTexture, PROTO}, ["symmetric", "active", "passive"] to {"symmetric", "active", "passive"}, etc. We should also remove the square brackets around text describing strings to avoid confusion.

See explanations here: https://en.wikipedia.org/wiki/Set_notation

@tpjnorton
Copy link
Collaborator Author

how is this?

@tpjnorton
Copy link
Collaborator Author

👍

Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We are getting closer

SFString type "radio" # {"radio", "serial", "infra-red"}
SFFloat range -1 # {-1, [0, inf)}
SFFloat maxRange -1 # {-1, [0, inf)}
SFFloat aperture -1 # [-1 ,[0, 2*pi]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks odd... Shouldn't it be {-1, [0, 2*pi]} instead?

SFVec3f axis 1 0 0 # [0, 1]
SFFloat suspensionSpringConstant 0 # [0, inf)
SFFloat suspensionDampingConstant 0 # [0, inf)
SFVec3f suspensionAxis 1 0 0 # [0, 1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of [0, 1] for axes, which is not very well understandable, I would simply write unit axis.

SFVec2f center 0.5 0.5
SFVec2f radialCoefficients 0 0
SFVec2f tangentialCoefficients 0 0
SFVec2f center 0.5 0.5 # [0, 1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks odd, maybe it would be better to write [0, 1] [0, 1] instead?

SFFloat consumptionFactor 10 # [0, inf)
SFVec3f controlPID 10 0 0 # [0, inf)
SFFloat minPosition 0 # [(-inf, inf), [-pi, pi]]
SFFloat maxPosition 0 # [(-inf, inf), [-pi, pi]]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That looks odd, I would rather write something like (-inf, inf) or [-pi, pi]

SFFloat maxPosition 0 # [(-inf, inf), [-pi, pi]]
SFFloat maxVelocity 10 # [0, inf)
SFString sound "" # any string
MFNode muscles [] # {Muscle (or derived PROTO)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's not consistent with other cases.

SFBool occlusion TRUE # should occlusions between the camera and the objects be checked
SFColor frameColor 1 0 0 # color of the object's frame in the overlay
SFInt32 frameThickness 1 # thickness of the object's frame in the overlay (pixels)
SFFloat maxRange 100 # [0, inf]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong

SFInt32 maxObjects -1 # {-1, [0, inf)}
SFBool occlusion TRUE # {TRUE, FALSE}
SFColor frameColor 1 0 0 # [0, 1]
SFInt32 frameThickness 1 # [0, inf]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wrong

SFFloat translationStep 0.01 # [0, inf)
SFFloat rotationStep 0.261799387 # [0, inf)
SFVec3f linearVelocity 0 0 0 # [0, inf)
SFVec3f angularVelocity 0 0 0 # [0, inf)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's odd, why can't it be any vector?

SFFloat cutOffAngle 0.785398 # [0, pi/2)
SFVec3f direction 0 0 -1 # (-inf, inf)
SFFloat intensity 1 # [0, 1]
SFVec3f location 0 0 10 # (-inf, inf)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have a problem with SFVec3f. Either we write "any vector" or something like "(-inf, inf) (-inf, inf) (-inf, inf)" or simply nothing. Similar problem with SFVec2f and SFRotation...

SFFloat resolution -1
SFString type "bumper" # ["bumper", "force", "force-3d"]
MFVec3f lookupTable [ 0 0 0, 5000 50000 0 ] # [see below]
SFFloat resolution -1 # [-1, (0, inf)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These 3 lines are wrong / non consistent.

@tpjnorton
Copy link
Collaborator Author

closer and closer still. I've fixed your comments and tried to improve SFVec3f, SFVec2f and SFRotation fields.

@tpjnorton
Copy link
Collaborator Author

👍

Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still...

SFFloat density 1000 # {-1, [0, inf)}
SFFloat mass -1 # {-1, [0, inf)}
MFVec3f centerOfMass [ ] # {-1, [0, inf)}
MFVec3f inertiaMatrix [ ] # {-1, [0, 1]}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those two lines are not understandable to me...

MFVec3f lookupTable [ 0 0 0, 5000 50000 0 ]
SFFloat resolution -1
SFString type "bumper" # {"bumper", "force", "force-3d"}
MFVec3f lookupTable [ 0 0 0, 5000 50000 0 ] # see below
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not consistent: you used "lookup table" previously.

SFString description "" # any string
SFFloat density 1000 # {-1, [0, inf)}
SFFloat viscosity 0.001 # [0, inf)
SFVec3f streamVelocity 0 0 0 # any positive vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does it really have to be positive?

SFFloat dampingConstant 0 # damping constant (Ns/m or Nms)
SFFloat staticFriction 0 # friction constant (Ns/m or Nms)
SFFloat position 0 # [0, inf)
SFVec3f axis 0 0 1 # [0, 1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

→ unit axis

SFBool visible TRUE
SFDouble maxRadius 0.2 # [0, inf)
SFVec3f startOffset 0 0 0 # any positive vector
SFVec3f endOffset 0 0 0 # any positive vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure they should be positive...

SFNode device NULL # RotationalMotor
SFNode fastHelix NULL # Solid node containing a graphical representation for rotation speed > 24 π rad/s (720 rpm)
SFNode slowHelix NULL # Solid node containing a graphical representation for rotation speed <= 24 π rad/s
SFVec3f shaftAxis 1 0 0 # [0, 1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit axis

SFNode animatedGeometry NULL
SFInt32 geometriesCount 10
MFNode device [ ] # {LinearMotor, PositionSensor, Brake, PROTO}
SFVec2f textureAnimation 0 0 # any positive vector
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure it should be positive...

SFFloat physicsDisableAngularThreshold 0.01 # [0, inf)
SFNode defaultDamping NULL # {Damping, PROTO}
SFFloat inkEvaporation 0 # [0, inf)
SFVec3f northDirection 1 0 0 # [-1, 1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unit axis

@tpjnorton
Copy link
Collaborator Author

👍

Copy link
Member

@omichel omichel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, there still problems...

SFFloat maxPosition 0 # (-inf, inf) or [-pi, pi]
SFFloat maxVelocity 10 # [0, inf)
SFString sound "" # any string
MFNode muscles [] # {Muscle (or derived PROTO)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not {Muscle, PROTO} as done everywhere else?

SFDouble maxRadius 0.2 # [0, inf)
SFVec3f startOffset 0 0 0 # any vector
SFVec3f endOffset 0 0 0 # any vector
MFColor colors [ ] # {SFColor, PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's a list of RGB colors here, no PROTO allowed, SFColor is not a node!

reference/pen.md Outdated
SFFloat leadSize 0.002
SFFloat maxDistance 0.0 # >= 0.0
SFBool write TRUE
SFColor inkColor 0 0 0 # [0, 1]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar problem as with SFVec3f, we should should use "any color" here.

SFVec2f torqueConstants 1 0 # any vector
SFNode device NULL # {Solid (or derived)}
SFNode fastHelix NULL # {Solid (or derived)}
SFNode slowHelix NULL # {Solid (or derived)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should add , PROTO to be consistent with endPoint.

SFFloat defaultFrequency 10 # [minFrequency, maxFrequency]
SFFloat minFrequency 1 # [0, maxFrequency)
SFFloat maxFrequency 25 # [minFrequency, inf)
SFNode rotatingHead NULL # {Solid (or derived)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

, PROTO

@tpjnorton
Copy link
Collaborator Author

I've fixed the last couple of comments and updated the color fields according to your suggestion.

Sorry, I'm finding this PR hard to verify myself.

@tpjnorton
Copy link
Collaborator Author

👍

Copy link
Member

@stefaniapedrazzi stefaniapedrazzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I quickly reviewed only the SFNode and MFNode additional information but there are still some errors and inconsistencies.

MFNode shaders NULL
SFString name "appearance"
SFNode material NULL # {Material, PROTO}
SFNode texture NULL # {ImageTexture, PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing "MultiTexture" and "ComposedCubeMapTexture"

SFNode jointParameters2 NULL # JointParameters for second axis
MFNode device2 [ ] # RotationalMotor, PositionSensor and Brake
SFFloat position2 0 # initial position with respect to the second hinge (rad)
SFNode jointParameters2 NULL # {JointParameters2, PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

JointParameters2 doesn't exist -> JointParameters

@@ -2,8 +2,8 @@

```
Joint {
SFNode jointParameters NULL # a joint parameters node
SFNode endPoint NULL # Solid or SolidReference
SFNode jointParameters NULL # {JointParameters, PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent JointParameters (or derived) -> depending on the type of joint JointParameters or HingeJointParameters is allowed

SFNode jointParameters NULL # a joint parameters node
SFNode endPoint NULL # Solid or SolidReference
SFNode jointParameters NULL # {JointParameters, PROTO}
SFNode endPoint NULL # {Solid, Slot, PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be consistent Solid (or derived) and missing SolidReference node.

SFVec3f centerOfThrust 0 0 0 # any vector
SFVec2f thrustConstants 1 0 # any vector
SFVec2f torqueConstants 1 0 # any vector
SFNode device NULL # {Solid (or derived), PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wrong: only RotationalMotor is allowed -> {RotationalMotor, PROTO}

@@ -4,8 +4,8 @@ Derived from [Joint](joint.md).

```
SliderJoint {
MFNode device [ ] # linear motor or linear position sensor
SFFloat position 0 # initial position (m)
MFNode device [ ] # {Linear Motor, Linear PositionSensor, PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • To be consistent with the other descriptions (see Track/HingeJoint node for example):

    • "Linear Motor" -> "LinearMotor"
    • "Linear PositionSensor" -> "PositionSensor"
  • Missing Brake

SFInt32 geometriesCount 10
MFNode device [ ] # {LinearMotor, PositionSensor, Brake, PROTO}
SFVec2f textureAnimation 0 0 # any vector
SFNode animatedGeometry NULL # {Shape, Group, PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing Slot and Transform

SFString type ""
SFNode endPoint NULL
SFString type "" # any string
SFNode endPoint NULL # {Slot, Group (or derived), PROTO}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing PointLight, SpotLight, Shape

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm tempted to put # {node, PROTO} here to be consistent with group.md.

@tpjnorton
Copy link
Collaborator Author

👍 (at this point I feel like the boy who cried "wolf")

@tpjnorton tpjnorton merged commit a5bc79e into master Feb 16, 2018
@tpjnorton tpjnorton deleted the cleanup-node-blocks branch February 16, 2018 08:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Development

Successfully merging this pull request may close these issues.

None yet

3 participants