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

minor bug fixes #685

Merged
merged 1 commit into from
Oct 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
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
Loading