Skip to content

Commit

Permalink
Merge pull request #685 from mcneel/AndyPayne/Compute-298
Browse files Browse the repository at this point in the history
minor bug fixes
  • Loading branch information
andyopayne authored Oct 30, 2024
2 parents 19889e3 + 9d2969e commit 0d72b28
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 38 deletions.
6 changes: 2 additions & 4 deletions CHANGELOG.HOPS.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.16.14] - 2024-10-11
## [0.16.14] - 2024-10-30

### Fixed

- Definitions which had nested Hops components in them which pointed to a URL were not deserializing the definition at the URL destination correctly. This was fixed.

- Fixed a bug where the open file icon shown in the Set Definition dialog was blurry.
- Minor bug fixes. Fixed a bug where the open file icon shown in the Set Definition dialog was blurry.

## [0.16.13] - 2024-08-29

Expand Down
4 changes: 2 additions & 2 deletions src/compute.geometry/GrasshopperDefinition.cs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ private static void Fsw_Changed(object sender, FileSystemEventArgs e)
_watchedFileRuntimeSerialNumber++;
}

static void LogDebug(string message) { Log.Debug(message); }
static void LogError(string message) { Log.Error(message); }
public static void LogDebug(string message) { Log.Debug(message); }
public static void LogError(string message) { Log.Error(message); }

public static GrasshopperDefinition FromUrl(string url, bool cache)
{
Expand Down
32 changes: 0 additions & 32 deletions src/compute.geometry/ResthopperEndpoints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,38 +27,6 @@ public void AddRoutes(IEndpointRouteBuilder app)
app.MapGet("/io", GetIoNames);
}

public static GH_Archive ArchiveFromUrl(string url)
{
if (string.IsNullOrWhiteSpace(url))
return null;

byte[] byteArray = null;
HttpWebRequest request = (HttpWebRequest)WebRequest.Create(url);
request.AutomaticDecompression = DecompressionMethods.GZip;
using (HttpWebResponse response = (HttpWebResponse)request.GetResponse())
using (var stream = response.GetResponseStream())
using (var memStream = new MemoryStream())
{
stream.CopyTo(memStream);
byteArray = memStream.ToArray();
}

try
{
var byteArchive = new GH_Archive();
if (byteArchive.Deserialize_Binary(byteArray))
return byteArchive;
}
catch (Exception) { }

var grasshopperXml = StripBom(System.Text.Encoding.UTF8.GetString(byteArray));
var xmlArchive = new GH_Archive();
if (xmlArchive.Deserialize_Xml(grasshopperXml))
return xmlArchive;

return null;
}

static void SetDefaultTolerances(double absoluteTolerance, double angleToleranceDegrees)
{
if (absoluteTolerance <= 0 || angleToleranceDegrees <= 0)
Expand Down

0 comments on commit 0d72b28

Please sign in to comment.