예제 #1
0
        public void RemoveToolpaths(ToolpathSO sourceSO)
        {
            List <AnalysisViz> found;

            lock (SOToAnalysis) {
                if (SOToAnalysis.TryGetValue(sourceSO, out found))
                {
                    foreach (var analysis in found)
                    {
                        analysis.OnComputeUpdateRequired  -= OnVisualizationRequestedUpdate;
                        analysis.OnGeometryUpdateRequired -= OnVisualizationHasGeometryUpdate;
                        analysis.Disconnect();
                    }
                    SOToAnalysis.Remove(sourceSO);
                }
            }
            lock (DirtyList) {
                if (found != null)
                {
                    foreach (var analysis in found)
                    {
                        DirtyList.Remove(analysis);
                    }
                }
            }
        }
예제 #2
0
        public ToolpathDeviationViz(ToolpathSO so)
        {
            SO = so;
            //SO.OnMeshModified += OnInputModified;

            HighDeviationMaterial = MaterialUtil.CreateTransparentMaterialF(Colorf.VideoRed);
            MedDeviationMaterial  = MaterialUtil.CreateTransparentMaterialF(Colorf.Orange);
            LowDeviationMaterial  = MaterialUtil.CreateTransparentMaterialF(Colorf.Yellow);
        }
예제 #3
0
        public void DiscardToolpaths()
        {
            if (CurrentToolpaths != null)
            {
                CC.GCodeAnalysis.RemoveToolpaths(CurrentToolpaths);
                CC.ActiveScene.RemoveSceneObject(CurrentToolpaths, true);
                CurrentToolpaths = null;
            }

            slice_gizmo_valid = false;
        }
예제 #4
0
        public void SetToolpaths(ToolpathGenerator generator)
        {
            DiscardToolpaths();

            ToolpathSO so = new ToolpathSO();

            so.Create(generator.Toolpaths, generator.Settings.CloneAs <SingleMaterialFFFSettings>(), CCMaterials.PreviewMeshMaterial);
            so.SetSlices(generator.Slices);

            CurrentLayersInfo = generator.LayerInfo;

            // make sure current layer value is valid
            current_layer = MathUtil.Clamp(current_layer, 0, CurrentLayersInfo.Count - 1);

            // update toolpaths
            CurrentToolpaths = so;
            CC.ActiveScene.AddSceneObject(CurrentToolpaths, false);
            CurrentToolpaths.ZInterval = CurrentLayersInfo.GetLayerZInterval(current_layer);

            CC.GCodeAnalysis.AddToolpaths(CurrentToolpaths);
        }
예제 #5
0
 private void OnInputModified(ToolpathSO so)
 {
     OnComputeUpdateRequired?.Invoke(this);
 }
예제 #6
0
        public void AddToolpaths(ToolpathSO sourceSO)
        {
            AnalysisViz boundaries = new ToolpathDeviationViz(sourceSO);

            add_new_so_analysis(sourceSO, boundaries);
        }