Repository navigation
feat: decode LAYER table and resolve BYLAYER colors across scene, SVG, and 2D viewer - #74
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
DwgLayerInfoandLayerParserto decodeLAYER(0x33) table records across R2004 (inline codepage strings) and R2007–R2018 (separate UTF-16LE string stream):Name,Handle, ACIColorIndex, 24-bitTrueColorRgb,IsFrozen,IsOff/IsOn,IsFrozenInNewViewports,IsLocked,IsPlottable,LineWeight, andIsVisible.DwgHandle.ResolveTarget(ownerHandle)for absolute and relative DWG handle codes (6,8,10,12) and extract each entity'sLayerHandle/LayerNameinEntityDecoder(R2010+handle stream andR2004decoded bodies).DwgEntity.EffectiveColorIndexandEffectiveTrueColorRgbto resolveBYLAYER(256) colours from the owning layer while keeping rawColorIndexuntouched.DwgReaderOptions.ReadLayers(defaulttrue) and exposeDwgDocument.Layers.Layersand resolvedBYLAYERcolours into:DwgJsonExporter(layersarray pluslayer,layerHandle,effectiveColorIndexon entities)DwgSceneReader(ColourOfresolvesBYLAYERcolours ontoSceneInstance)DwgSvgExporter(resolvesBYLAYERstroke/fill colours)dwgio inspect(prints decodedLayers:summary)DwgCadHtmlViewer(exports layer list, initializes AutoCADOn/Frozenvisibility, adds interactive layer visibility chips in the sidebar, displaysLayerin Properties, and rendersBYLAYERcolours)LayersTestscovering R2010/R2013/R2018 public fixtures, synthetic R2018 & R2004 layer records, handle offset codes,ReadLayers = false, and JSON/Scene/SVG/CLI/2D-viewer integration.Stacked on #73.
Verification
dotnet build DwgIO.slnx -c Release— 0 warnings, 0 errorsdotnet test DwgIO.slnx -c Release --no-build— 286 passed, 0 failed, 1 skipped (unconfigured private fixtures) on bothnet8.0andnet10.0BuildNativeCoreOnly=truepassed cleanly for bothDwgIO.csprojandDwgIO.Scene.csproj