Closed Eckart-S closed 6 years ago
I think there should be very clear rules about how to store data, otherwise every plugin will do this slightly different (due to API, etc.) and then the converters need to consider all those different cases and plugins.
Some Images...
GH/RHINO (Source)
DYNAMO
VIEWER
Stream ID: B1wYYERjM
Vectors not visible (probably intention?)
For the moment, yes.
Circles not visible Ellipses not visible (1 of 25 made it through) Arcs circular not visible Planes not visible (probably intention?)
These should be supported. They've been tested with GH -> viewer. Will try to figure out what's going on.
@Eckart-S , when you have time, could you drop the gh/ rh + gh file for that geom generation?
Sure, need to have a look when I'm back in the office
Circles are SpeckleArc (with 360° angle) currently, btw.
Ok, i've been doing some tests & hopefully will be fixing some identified bugs re polylines & lines.
actually last commit is this https://github.com/speckleworks/SpeckleRhino/commit/7834ad4b38733a516fd9376b366ba54d1571a1dc on this issue, it's mostly speckle rhino converter stuff 🙃
Regarding the nurbs curve part, i would suggest potentially just plopping out the polyline (its displayValue
) as a temporary filler. won't say it, but @teocomi could help ;)
Well, Dynamo/DesignScript knows elliptical arcs hence i asked. But i think Rhino might not and possibly Revit neither, so this is kind of last last last priority :)
Planes with parameters would be cool though :) What happens if i deliver them to RH/GH with userdata attached? Ignore or explosion?
Good regarding the polylines - that's what the closed parameter is for.
Hmm i think i used Rh5. Are they proper SpeckleCircles? Some software might be weird with Arcs and 360° angle. Dynamo fix works but you never know.
Not sure how you make an ellipitcal arc in Rhino, but the parameters to define one are there:
From converter.js in viewer:
Ellipse( args, cb ) {
let xRadius = args.obj.firstRadius
let yRadius = args.obj.secondRadius
let startAngle = args.obj.startAngle
let endAngle = args.obj.endAngle
let v1 = new THREE.Vector3( 0, 0, 1 )
let v2 = new THREE.Vector3( ...args.obj.plane.Normal.value )
let q = new THREE.Quaternion( )
q.setFromUnitVectors( v1, v2 )
let curve = new THREE.EllipseCurve( 0, 0, radius, radius, startAngle, endAngle, false, 0 )
let points = curve.getPoints( 50 )
let geometry = new THREE.Geometry( ).setFromPoints( points )
let arc = new THREE.Line( geometry, args.layer.threeLineMaterial )
arc.geometry.applyMatrix( new THREE.Matrix4( ).makeRotationFromQuaternion( q ) );
arc.geometry.applyMatrix( new THREE.Matrix4( ).makeTranslation( ...args.obj.plane.Origin.value ) );
arc.hash = args.obj.hash
cb( null, arc )
},
Re Circles: Speckle does some back to Rhino Geometry conversion basics to be able to keep user data safely.
Therefore, when you receive a circle in Gh/Rh, it gets converted into a ArcCurve, which according the rhino sdk, "represents circles and arcs". I knew there was a reason for this! The problem with casting it back to a normal Circle is that Circles are some sort of structs, and you cannot assign user dictionaries to them.
It's something that hopefully one day will be cleared & cleaned up on the rhino side...
Re Ellipses, i couldn't get mine showing up in the viewer either.
vs
Here is the ref stream. We'll dig into this.
Can we have a status update on this one? I think most of the fixable stuff is fixed, so I will close but will reopen if needed.
I would keep viewer considerations in a different issue in https://github.com/speckleworks/SpeckleViewer.
I did some more work on the DSConverter and this is what is still open and maybe SpeckleCore issues? I only did a quick test, it is not checked if geometry perfectly matches input 100%, yet.
(SetUserData node has error)
(uses SpecklePolyline class)
(uses SpecklePolyline class)
Has duplicated start + end point
(uses SpeckleArc class)
(Nurbs input unsuitable)
(Nurbs input unsuitable)
(SetUserData node has error)
Nurbs issues
ERROR Unable to create BSplineCurve from vertices : B-spline knot sequence is decreasing (should be non-decreasing)
NOTE Degree: Should be greater than 1 (piecewise-linear spline) and less than 26 (the maximum B-spline basis degree supported by ASM). Weights: All weight values (if supplied) should be strictly positive. Weights smaller than 1e-11 will be rejected and the function will fail. Knots: The knot vector should be a non-decreasing sequence. Interior knot multiplicity should be no larger than degree + 1 at the start/end knot and degree at an internal knot (this allows curves with G1 discontinuities to be represented). Note that non-clamped knot vectors are supported, but will be converted to clamped ones, with the corresponding changes applied to the control point/weight data. Knot Array: The array size must be num_control_points + degree + 1
What do we change in SpeckleCore, which needs to be adjusted in other places?