Pre loader

Maximum Mesh Id

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

1
0

I’m working with Custom Meshes. I want the user to be able to delete and create an arbitrary number of meshes. It’s fine if there’s a maximum number of meshes that can exist at a time. However, by repeatedly clearing and creating the same mesh, I get this error;

System.InvalidOperationException: ‘The Maximum Mesh ID has been exceeded. Please see http://www.scichart.com/maximum-mesh-id

I get the error when I try to add a FreeSurfaceRenderableSeries3D object to the a Scichart3DSurface.RenderableSeries. The link provided by the error got 404’d. I have sixteen SceneObject objects and one TextSceneEntity, borrowed from the example suite. While reproducing the error, I never had more than one mesh. I cleared the RenderableSeries before inserting another mesh.

Is it possible to keep adding meshes as long as I delete them, or does a SciChart3DSurface have a maximum number of meshes that can be added, even with deletion?

Version
7.0.1.27055
  • You must to post comments
1
0

Hi Will, not sure what happened to the documentation page.

Basically Mesh ID is limited to 32 bits, so that’s Int32.MaxValue is your limit: around 2.1 billion meshes. So far you’re the first to hit that limit. Congrats!

Mesh IDs and Vertex IDs are used internally to handle our selection (click / tooltip interaction) on 3D charts. We have to encode everything with a pair of IDs so that when you click on the chart we can report what was clicked.

There is a piece of code called DefaultEntityIdProvider which inherits IEntityIdProvider. This is attached to BaseSceneEntity.EntityIdProvider and has functions to GetEntityId() and ReleaseEntityId() so we should be recycling them.

Quick question – is it easy to reproduce this? If we add/remove a 3D Chart series in a loop will it cause the max mesh ID to be reached? If there’s anything else can you provide code to reproduce?

Best regards,
Andrew

  • You must to post comments
0
0

I have a complicated application I’m working on here, so I’m not going to be totally convinced I haven’t done something wrong until I figure out what the problem is, but here’s what I do know. I have a Geofence class with a property public FreeSurfaceRenderableSeries3D FreeSurfaceRenderableSeries3D. I have an Geofence object called geofence. I also have a LightningChart object. For the LightningChart class, in the XAML I defined a SciChart3DSurface named sciChart, which has a SciChart3DSurface.RenderableSeries named ScatterRenderableSeries3D, similar to many examples in the suite. The exception is thrown on this line…

_parentChart.sciChart.RenderableSeries.Add(geofence.FreeSurfaceRenderableSeries3D);

where _parentChart is a LightningChart object, _parentChart.sciChart.RenderableSeries is a SciChart3DSurface.RenderableSeries object, and geofence.FreeSurfaceRenderableSeries3D is a FreeSurfaceRenderableSeries3D object. I also have this line here…

var id = geofence.FreeSurfaceRenderableSeries3D.GetSceneEntity().EntityId;

I have a button in my application that clears the RenderableSeries (except for the ScatterRenderableSeries3D). This button also then creates n number of geofences. When a geofence is created, this line is executed;

_parentChart.sciChart.RenderableSeries.Add(geofence.FreeSurfaceRenderableSeries3D);

By using var id, I can confirm that the id’s are getting recycled. When n is 5, I create 5 geofences and insert 5 FreeSurfaceRenderableSeries3D objects into the SciChart3DSurface.RenderableSeries object. This starts at id 24, and works its way up to id 28. However, at some point, the error is thrown. Sometimes, it happens when I click the button, but not when the geofences before I click the button. Sometimes, one of the FreeSurfaceRenderableSeries3D will have an id of ‘7’. If I see an id of 7, the next button click will induce the error but it is not a prerequisite.

It seems to me that I’m not actually using too many id’s. The visual studio memory manager doesn’t indicate any runaway object creation, and some of the time I’m able to re-use id’s. Here are the full details of the exception

System.InvalidOperationException
HResult=0x80131509
Message=The Maximum Mesh ID has been exceeded. Please see http://www.scichart.com/maximum-mesh-id
Source=SciChart.Charting3D
StackTrace:
at SciChart.Charting3D.Primitives.DefaultEntityIdProvider.GetEntityId()
at SciChart.Charting3D.Primitives.BaseSceneEntity1.SetEntityIdProvider(IEntityIdProvider eip)
at SciChart.Charting3D.Primitives.BaseSceneEntity
1.VisitEntities(Action1 operation)
at SciChart.Charting3D.Primitives.BaseSceneEntity
1.set_EntityIdProvider(IEntityIdProvider value)
at SciChart.Charting3D.Primitives.BaseSceneEntity1.AttachChild(IBaseSceneEntity entity)
at SciChart.Charting3D.Primitives.BaseSceneEntity
1.OnChildEntitiesCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at SciChart.Charting3D.Primitives.SceneEntityCollection.OnObservableCollectionChanged(CollectionChangedArgs nativeArgs)
at SciChart.Charting3D.Interop.VXccelEngine3DPINVOKE.SCRTSceneEntityObservableCollection_Add__SWIG_0(HandleRef jarg1, HandleRef jarg2)
at SciChart.Charting3D.Interop.SCRTSceneEntityObservableCollection.Add(SCRTSceneEntity _rItem)
at SciChart.Charting3D.SciChart3DSurface.AttachRenderableSeries(IRenderableSeries3D rSeries)
at SciChart.Core.Extensions.EnumerableExtensions.ForEachDo[T](IEnumerable1 enumerable, Action1 operation)
at SciChart.Charting3D.SciChart3DSurface.OnRenderableSeriesCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection
1.InsertItem(Int32 index, T item)
at Lm3dApplication.GeofenceHandler.AddGeofence(String definitionString) in C:\Users\Will\Documents\git\front_end\application\GeofenceHandler.cs:line 181

I don’t know how to escape the tildas, but where the output changes format is a tilda character.

  • You must to post comments
0
0

I suspect this issue is related so I’ll put this here. While adding meshes to the rendersurface, sometimes I get a System.AccessViolationException. The callstack is as follows

[Managed to Native Transition]
SciChart.Charting3D.dll!SciChart.Charting3D.Interop.SCRTFreeSurfaceSceneEntity.UpdateMeshes(float[] _paXCoords, float[] _paYCoords, float[] _paZCoords, float[] _paDisplacementCoords, uint[] _paCellColors, int _iGridWidth, int _iGridHeight) Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.RenderableSeries.FreeSurfaceSceneEntity.CreateNativeMeshes(SciChart.Charting3D.Primitives.IRenderPassInfo3D rpi, SciChart.Charting3D.Model.IPointSeries3D pointSeries, SciChart.Charting3D.RenderableSeries.Point3DXyzDisplacementData data) Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.RenderableSeries.BaseRenderableSeriesSceneEntity3D<SciChart.Charting3D.RenderableSeries.FreeSurfaceRenderableSeries3D, SciChart.Charting3D.RenderableSeries.Point3DXyzDisplacementData, SciChart.Charting3D.Interop.SCRTFreeSurfaceSceneEntity>.UpdateScene(SciChart.Charting3D.Primitives.IRenderPassInfo3D rpi) Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.Primitives.BaseSceneEntity<System.__Canon>.Update() Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.Primitives.BaseSceneEntity<SciChart.Charting3D.Interop.SCRTFreeSurfaceSceneEntity>.Update(float fDeltaTime) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
SciChart.Charting3D.dll!SciChart.Charting3D.Interop.SCRTSceneEntity.Update(float _fDeltaTime) Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.Primitives.BaseSceneEntity<System.__Canon>.Update(float fDeltaTime) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
SciChart.Charting3D.dll!SciChart.Charting3D.Interop.SCRTCallbacks.OnUpdate(float _fDeltaTime) Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.Viewport3D.DrawFrameInternal(SciChart.Charting3D.Primitives.ISceneDescriptor sceneDescriptor) Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.Viewport3D.FillSource(SciChart.Charting3D.Primitives.ISceneDescriptor sceneDescriptor) Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.SciChart3DRenderer.RenderLoop() Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.SciChart3DSurface.DoDrawingLoop() Unknown
SciChart.Charting3D.dll!SciChart.Charting3D.SciChart3DSurface.OnRenderSurfaceDraw.AnonymousMethod__0() Unknown
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget) Unknown
PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandler(object resizedCompositionTarget) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() Unknown
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.CallbackWrapper(object obj) Unknown
mscorlib.dll!System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state, bool preserveSyncCtx) Unknown
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!MS.Internal.CulturePreservingExecutionContext.Run(MS.Internal.CulturePreservingExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Unknown
WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, int numArgs) Unknown
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source, System.Delegate callback, object args, int numArgs, System.Delegate catchHandler) Unknown
WindowsBase.dll!System.Windows.Threading.Dispatcher.LegacyInvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, int numArgs) Unknown
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) Unknown
[Native to Managed Transition]
[Managed to Native Transition]
WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) Unknown
PresentationFramework.dll!System.Windows.Application.RunDispatcher(object ignore) Unknown
PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) Unknown
LM3D_APPLICATION.exe!Lm3dApplication.App.Main() Unknown

The error also gives the following details…

System.AccessViolationException
HResult=0x80004003
Message=Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
Source=
StackTrace:

Attached is a .txt with the callstack and error details.

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies