TextEntity Vertical and Horizontal Alignment on Dwg Writer

Aperta
#730 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 3 giorni

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
tooling

Direzione di ricerca

Start by reading the TextEntity alignment handling in DwgWriter and compare it with the DXF output for the provided reproduction. Verify the generated DWG in BricsCAD; the work is done when centered text has the same visual alignment as the DXF without needing to move the entity.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

bug

Describe the bug
The TextEntity objects have incorrect visual aspect when VerticalAlignment and HorizontalAlignment properties are set in the given way.

To Reproduce
Use the following code:

using ACadSharp;
using ACadSharp.Entities;
using ACadSharp.IO;
using CSMath;

var doc = new CadDocument();

var text = new TextEntity
{
    Value = "My Text Content",
    InsertPoint = new XYZ(0, 0, 0),
    AlignmentPoint = new XYZ(0, 0, 0),
    Height = 2,
    VerticalAlignment = TextVerticalAlignmentType.Middle, //this line generates a problem with dwg files
    HorizontalAlignment = TextHorizontalAlignment.Center //and this line also generates a problem dwg files
};
doc.ModelSpace.Entities.Add(text);

using (var dwgWriter = new DwgWriter(@"c:\dev\dwgFileIncorrectBehavior.dwg", doc))
{
    dwgWriter.Write();
}

using (var dxfWriter = new DxfWriter(@"c:\dev\dxfFileAwesome.dxf", doc, false))
{
    dxfWriter.Write();
}

Two files are going to be created. The dxf file works as expected. The dwg file has the visual issue.

Print of dxf file on BricsCad:
Image

Print of dwg file on BricsCad:
Image

Expected behavior
The TextEntity should have on dwg file the same visual aspect as in the dxf file (centralized).

Additional context
The dwg isn't all incorrect. If the TextEntity objects are moved, the expected behavior is shown (the TextEntity start to be visually is centralized):

Print after using the command MOVE on the TextEntity on the dwg file:
Image


Release needed

  • Yes, using the Nuget package.
  • No, using the github repo.
Lingua principale
C#
Stelle
873
Fork
223
Merge medio
1g 15h
PR unite (30g)
28

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di DomCR/ACadSharp

Tutte le issue di DomCR/ACadSharp

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.