Unreal Datasmith Export - How to set Pivotpoint of Datasmith Mesh? - unreal-engine5

i'm currently developing a Datasmith export feature for an AutoCAD plugin. I'm almost done but I can't figure out how to set the pivot point of a mesh.
I've sticked to the SDK Guidelines here:
https://docs.unrealengine.com/5.0/en-US/datasmith-export-sdk-guidelines/
At some point it says
Mesh pivots must be calculated in the mesh so they don't all end up at 0, 0, 0.
Which is something I whould like to do but I can't find a way in the SDK to set the pivot...
I've expected a function like SetPivotPoint(x,y,z) or something like that on one of these types:
FDatasmithMesh
IDatasmithMeshElement
IDatasmithMeshActorElement
... But nothing :(
Any help please?

I've just understood what is meant by "the pivot point must be baked into the mesh". I've took all the points of the AutoCAD geometries and created meshes out of them as they are. But the mesh itself must be builded around the point where I want the pivot point to be (relative to the mesh).
So I think the correct way to do this is to translate all the points of the ACAD geometry so that the center point (where I want the pivot to be) is 0,0,0.
Then I build the mesh around it and translate the mesh actor, that holds the instance of the mesh, to the position in the scene where the mesh should be.
Edit: That was exactly the solution...just in case anyone else has the same problem.

Related

Exploding only some part of an object in Blender 2.82a (using Explode modifier with Vertex Group?)

I am trying to explode/destroy only some part of an object.
Following Blender 2.82 manual page
https://docs.blender.org/manual/en/2.82/physics/particles/emitter/emission.html
says "You may use vertex groups to confine the emission, that is done in the Vertex Groups panel."
So, it must be possible.
As a test, I created a Blender file, attempting to explode/destroy only the left ear of Suzanne, using Explode modifier.
I tried the following:
Added a monkey object ("Suzanne").
Applied "Subdivision Modifier" with "Simple" subdivision algorithm.
Created a vertex group named "VtxGroup_Suzanne__All_vertices_in_left_ear", which contains all vertices in Suzanne's left ear.
enter image description here
Created particle system setting.
Enabled Rotation.
In "Density" field under "Vertex Groups", entered "VtxGroup_Suzanne__All_vertices_in_left_ear".
In "Render As" filed under "Render", chose "Object".
Added "Explode" modifier.
This modifier has "Vertex Group" field, but it seems it does not make any difference in the result (probably because I do not know how to use it properly???)
At this point, when I play the animation, particles erupt out of Suzanne's left ear, breaking down Suzanne little by little.
However, the destruction is not limited to the left year. Entire Suzanne starts breaking down.
Some destruction pieces are really big or unnaturally long, such as almost half of Suzanne's face shown in the screenshot.
enter image description here
Is there any way I can limit the destruction only to the left ear (which is vertex group "VtxGroup_Suzanne__All_vertices_in_left_ear".
Also, can I adjust the sizes of destruction particles, so that some of them would not be too big, nor too long?
I tried setting a whole bunch of settings, but I could not find the solution. Maybe I am attempting this completely wrong? Is there some way to accomplish this in a completely different way?
This test file is found here (zipped):
Test file for Explode modifier with Vertex Group
Thank you in advance for help.
Try splitting the object? If you want to animate the object beforehand, construct the object out of two separate objects grouped, and then ungroup them at or before the keyframe you want them to explode. I hope this helps!
:)

Is it possible to use the Projection_traits_xy_3 adapter with the "2D Polyline Simplification" package to simplify 2.5D polylines with CGAL?

I need to simplify a set of 2.5D polylines. Specifically, 3D polylines that do not overlap in the XY plane.
I tried to use the Projection_traits_xy_3 adapter with the "2D Polyline Simplification" package from CGAL, but I have compilation errors when calling the function CGAL::Polyline_simplification_2::simplify, after building the triangulation.
If what I'm trying to do is currently possible to do with CGAL, please someone can show me the basic example code.
Thank you for pointing this out. I added the point/segment distance to Projection_traits_xy_3 and added an example in this pull request.

cytoscape show traffic between nodes along an animated path

I need to show things moving between nodes along their connection paths similar to this project. I haven't been able to find any examples of it in cytoscape, but I have used cytoscape in the past and prefer to keep using it for this as well. I would appreciate recommendations on how to approach this problem.
You've got a few options...
The easiest is the Marquee visual style. It produces a "marching ants" illusion in the direction of directed edges. Simply to the Styles tab in the Control Panel and select the "Marquee" style. In the EDGE tab, you can choose from 3 different Marquee Line Types. You could imagine mapping these 3 line types to 3 categories (or bins) of traffic density, for example. Or you could use color, thickness and/or transparency in combination with a marquee style to represent traffic density. You can see an example here:
https://youtu.be/MF0zsxEPoPc?t=44
There's also an app for animation! This takes the approach of interpolating any visual style (including position and existence) between any set of key frames you provide. So, for example, you would have a start and finish frame and then CyAnimator would make a movie file for you:
http://apps.cytoscape.org/apps/cyanimator
And yet another completely different approach: with the scripting capabilities of Cytoscape, you can pretty much do whatever you want. The Unit tests for the RCy3 package, for example, ends up being an almost psychedelic display of data vis potential (and the unit tests aren't even at full coverage, shame). So you could direct your own animations in real time with a bit of scripting in R or Python. Here's the RCy3 unit test demo and links to the scripting libs:
https://www.youtube.com/watch?v=IXqbdlUnzUE&t=1s (caution: flashing graphics)
https://bioconductor.org/packages/release/bioc/html/RCy3.html
https://py2cytoscape.readthedocs.io/en/latest/
I'm using cytoscape.js with meteor.js. My elements, stylesheet and vehicles (shown as red dots) are stored in mongo, and can be updated via an external process or edited on-screen. The graph can be restructured or reshaped on the fly, and the vehicles will discover the new least-cost route to reach their target. Moves are queued with eles.animate() Routing is handled by eles.floydWarshall().path(). This might be similar to what you had in mind.

.mesh file "ref" var explanation

I am trying to understand the .mesh files, usually generated for mesh visualization with Medit.
The documentation is here, but it is in french.
The thing I understand is that after every line describing and object in the file (vertex, triangle, tetrahedra, etc.) it comes a ref variable, that in the examples files I have, they usually are 0,1,2,3 and I don't understand what is their purpose.
Can somebody please explain this?
You can get an .mesh example here.
Each reference corresponds to a color in Medit. The colors are arbitrary, and can be changed in Medit (using the GUI or changing a configuration file).
The reference values in the Mesh file refers to a color index. Maybe the program uses this to display the vertices, triangles and tetrahedra with certain colors. You can ignore this value for all practical purposes.

Draw a Route between starting point to end point in google mapview

I am developing a Demo project in Xcode to draw a route between two places.
For example, from a particular starting place to end place according to latitude and longitude. However, I could not understand how to do it? With the help of google api or from any other process?
To draw a line between the starting point and ending point the best place to start is the Apple Source Code Here, it does everything and more: http://developer.apple.com/library/ios/#samplecode/Breadcrumb/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010048-Intro-DontLinkElementID_2
You need to make a request to http://maps.google.com/maps?dirflg=w&output=dragdir&saddr=lat,lng&daddr=lat,lng ( more information on parameters can be found here: http://mapki.com/wiki/Google_Map_Parameters#Directions )
It will return points in encoded format, decode them using code from http://fkn1337.com/decode-google-maps-polylines-objective-c/
Construct MKPolyline object from this points and add it to the map.
If you want to draw route between two points in map view it is better to use Regexkitlite framework classes which will describe clearly how to achieve this.For reference and sample code go through this link.
http://sugartin.info/2011/10/12/drawing-route-on-google-map-mkmapview