Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Geometric transform #457

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ad9289b
submodules
DomCR Sep 24, 2024
9d95a94
update utilities
DomCR Sep 24, 2024
821b997
entity abstract methods
DomCR Sep 24, 2024
cbcc68d
implementation
DomCR Sep 24, 2024
98fa6b3
Merge remote-tracking branch 'origin/master' into Geometric-transform
DomCR Sep 27, 2024
e92fe2e
merge
DomCR Feb 15, 2025
d55097b
submodule
DomCR Feb 15, 2025
29da415
build fix
DomCR Feb 15, 2025
6a1b80a
merge
DomCR Feb 15, 2025
36b638a
save
DomCR Feb 15, 2025
1239aab
Merge remote-tracking branch 'origin/master' into Geometric-transform
DomCR Feb 15, 2025
d6d3542
methods
DomCR Feb 15, 2025
b58cccb
line translation
DomCR Feb 15, 2025
2214de9
EscalationTest
DomCR Feb 15, 2025
6bda832
line transform
DomCR Feb 15, 2025
00e4437
point
DomCR Feb 15, 2025
106dd68
circle
DomCR Feb 17, 2025
7790c03
arc
DomCR Feb 17, 2025
dd1cb37
insert
DomCR Feb 17, 2025
2757c61
submodule
DomCR Feb 17, 2025
1532858
aligned
DomCR Feb 17, 2025
5fc3d41
format
DomCR Feb 21, 2025
8f0092b
merge
DomCR Feb 27, 2025
26fa0e6
insert fix
DomCR Feb 27, 2025
2765b6b
insert fix
DomCR Mar 1, 2025
c870306
text transform
DomCR Mar 3, 2025
89ebfd0
mtext
DomCR Mar 3, 2025
a0c4e90
ellipse
DomCR Mar 4, 2025
9a40f07
submodule
DomCR Mar 4, 2025
8f5b3bc
DimensionAngular2Line
DomCR Mar 4, 2025
98d9e9c
DimensionAngular3Pt
DomCR Mar 4, 2025
5e17730
DimensionDiameter
DomCR Mar 4, 2025
6471413
comment
DomCR Mar 5, 2025
bc5925e
DimensionOrdinate
DomCR Mar 5, 2025
3a1a4b5
radius
DomCR Mar 5, 2025
e650d2f
face3d n block
DomCR Mar 5, 2025
c42604b
polyline
DomCR Mar 5, 2025
22c4609
xline
DomCR Mar 5, 2025
31889c5
CadWipeoutBase
DomCR Mar 7, 2025
1ebca66
tolerance
DomCR Mar 7, 2025
094f366
spline n viewport
DomCR Mar 7, 2025
b30f393
spline
DomCR Mar 7, 2025
af0c8b9
solid
DomCR Mar 7, 2025
7825ec5
shape
DomCR Mar 7, 2025
04a6844
ray
DomCR Mar 7, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
build fix
  • Loading branch information
DomCR committed Feb 15, 2025
commit 29da415278b5822dd302ec369bcf0f8dac0591b6
2 changes: 1 addition & 1 deletion src/ACadSharp.Tests/Entities/PointTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public void TranslateTest()

Point point = new Point(init);

point.Translate(translation);
point.ApplyTranslation(translation);

AssertUtils.AreEqual(result, point.Location, "Point Location");
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Blocks/Block.cs
Original file line number Diff line number Diff line change
Expand Up @@ -87,19 +87,19 @@ public override CadObject Clone()
}

/// <inheritdoc/>
public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new System.NotImplementedException();
}

/// <inheritdoc/>
public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new System.NotImplementedException();
}

/// <inheritdoc/>
public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new System.NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Blocks/BlockEnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,19 +45,19 @@ public override BoundingBox GetBoundingBox()
}

/// <inheritdoc/>
public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new System.NotImplementedException();
}

/// <inheritdoc/>
public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new System.NotImplementedException();
}

/// <inheritdoc/>
public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new System.NotImplementedException();
}
Expand Down
4 changes: 2 additions & 2 deletions src/ACadSharp/Entities/Arc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public List<XY> PolygonalVertexes(int precision)
double cosine = this.Radius * Math.Cos(angle);
double sine = this.Radius * Math.Sin(angle);

cosine = Utilities.IsZero(cosine) ? 0 : cosine;
sine = Utilities.IsZero(sine) ? 0 : sine;
cosine = MathHelper.IsZero(cosine) ? 0 : cosine;
sine = MathHelper.IsZero(sine) ? 0 : sine;

ocsVertexes.Add(new XY(cosine + this.Center.X, sine + this.Center.Y));
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/CadWipeoutBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,17 +215,17 @@ public override void ApplyTransform(Transform transform)
throw new NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/Circle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,17 +74,17 @@ public override BoundingBox GetBoundingBox()
return new BoundingBox(min, max);
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/DimensionAligned.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ public override BoundingBox GetBoundingBox()
return new BoundingBox(this.FirstPoint, this.SecondPoint);
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new System.NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new System.NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new System.NotImplementedException();
}
Expand Down
8 changes: 4 additions & 4 deletions src/ACadSharp/Entities/DimensionAngular2Line.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override double Measurement
XY v1 = (XY)(this.SecondPoint - this.FirstPoint);
XY v2 = (XY)(this.DefinitionPoint - this.AngleVertex);

return v1.AngleFrom(v2);
return v1.AngleBetweenVectors(v2);
}
}

Expand All @@ -72,17 +72,17 @@ public override BoundingBox GetBoundingBox()
return new BoundingBox(this.FirstPoint, this.SecondPoint);
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new System.NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new System.NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new System.NotImplementedException();
}
Expand Down
8 changes: 4 additions & 4 deletions src/ACadSharp/Entities/DimensionAngular3Pt.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ public override double Measurement
return Math.PI;
}

return (double)v1.AngleFrom(v2);
return (double)v1.AngleBetweenVectors(v2);
}
}

Expand All @@ -75,17 +75,17 @@ public override BoundingBox GetBoundingBox()
return new BoundingBox(this.FirstPoint, this.SecondPoint);
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/DimensionDiameter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ public override BoundingBox GetBoundingBox()
return new BoundingBox(this.InsertionPoint - this.AngleVertex, this.InsertionPoint + this.AngleVertex);
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new System.NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new System.NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new System.NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/DimensionOrdinate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,17 +88,17 @@ public override BoundingBox GetBoundingBox()
return new BoundingBox(this.FeatureLocation, this.LeaderEndpoint);
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/DimensionRadius.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,17 +55,17 @@ public override BoundingBox GetBoundingBox()
return new BoundingBox(this.InsertionPoint - this.AngleVertex, this.InsertionPoint + this.AngleVertex);
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new System.NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new System.NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new System.NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/Ellipse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,17 +196,17 @@ public override BoundingBox GetBoundingBox()
return BoundingBox.FromPoints(pts.Select(p => (XYZ)p));
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/Entity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,20 +118,20 @@ public Entity() : base() { }
/// Apply a translation to this entity.
/// </summary>
/// <param name="translation"></param>
public abstract void Translate(XYZ translation);
public abstract void ApplyTranslation(XYZ translation);

/// <summary>
/// Apply a rotation to this entity.
/// </summary>
/// <param name="rotation"></param>
/// <param name="axis"></param>
public abstract void Rotate(double rotation, XYZ axis);
public abstract void ApplyRotation(double rotation, XYZ axis);

/// <summary>
/// Apply a scale to this entity.
/// </summary>
/// <param name="scale"></param>
public abstract void Scale(XYZ scale);
public abstract void ApplyEscalation(XYZ scale);

/// <summary>
/// Apply a transform matrix to this entity.
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/Face3D.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,17 +65,17 @@ public override BoundingBox GetBoundingBox()
return BoundingBox.FromPoints(new List<XYZ> { this.FirstCorner, this.SecondCorner, this.ThirdCorner, this.FourthCorner });
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new System.NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new System.NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new System.NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/Hatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,17 +166,17 @@ public override CadObject Clone()
return clone;
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/Insert.cs
Original file line number Diff line number Diff line change
Expand Up @@ -232,17 +232,17 @@ internal override void UnassignDocument()
base.UnassignDocument();
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}
Expand Down
6 changes: 3 additions & 3 deletions src/ACadSharp/Entities/Leader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -190,17 +190,17 @@ protected override void tableOnRemove(object sender, CollectionChangedEventArgs
}
}

public override void Translate(XYZ translation)
public override void ApplyTranslation(XYZ translation)
{
throw new NotImplementedException();
}

public override void Rotate(double rotation, XYZ axis)
public override void ApplyRotation(double rotation, XYZ axis)
{
throw new NotImplementedException();
}

public override void Scale(XYZ scale)
public override void ApplyEscalation(XYZ scale)
{
throw new NotImplementedException();
}
Expand Down
Loading
Loading