dynamicsoar's log

主に研究関係のメモ

Using US keyboard but cannot remove UK keyboard from lang list --> install English (United Kingdom) *language* then delete it

After the update to the latest build of the Windows 10 (that I applied today), the languages went back to the default, which is a mess. I'm using a US keyboard but somehow the UK keyboard appears on the language list, perhaps something to do with the fact that I'm living in the UK. I need this language list as I need to quite often change the langs between English and Japanese.

Googled a bit, and found this thread:

answers.microsoft.com

Not to be confused with the UK keyboard layout for English (United States). Adding this or removing this won't affect at all. Instead, you should press the button "+ Add a preferred language" and add "English (United Kingdom)". You can untick as much as possible. When installed, delete it. This worked for me.

1Password でいくつかのエントリだけ Dropbox sync ができてないとき→できてないやつを編集すればいい(かも)

Mac と Winマシンで sync しているのに、理由は不明だが、メインで使っている(=パスワードを登録することの多い)Mac にだけあって Win には出てこないエントリがけっこうあった。Dropbox を一時的に切ってる状態でパスワード作成した、とかだろうか…?いずれにせよ、Mac 側の 1Password でエントリを編集(たとえば、登録名をほんの少し変えるとか、なんでもよさそう)すると、無事 sync してくれた。

環境としては、

サブスクリプションにはギリギリまで抵抗する予定…(すでに Win の Chrome extension 動かないんだけど)。

Grasshopper を使い始めた

これまで Rhino, Python script と使ってきたけど、Grasshopper でパラメトリックモデリングができることに最近気づいてしまった(というかそのためにあるようなもんだった)ので、使い始めた。もっと早く使っておくのだった。D論があと1年は早く出せたのではないか。

Rhino とは微妙にコマンドオプションが一致していなかったりして、使いづらいこともあるけど、やはり自動化の恩恵はとんでもなく大きい。ドキュメントが貧弱すぎることが問題だが、ある程度は YouTube 等に有志が上げてくれているチュートリアル動画、ある程度はフォーラムでカヴァされている。

たとえば、Rhino での NetworkSrf に相当しそうな Network Surface というコンポーネントはあるが、tolerance の設定ができず詰んでいた。ググっていると、フォーラムの Network surf tangency continuity - Grasshopper - McNeel Forum でフグの人(戦闘力高い)が C# スクリプトを上げてくれており、これが完全にそのまま使えた。メッチャありがたい。なお seam 位置については、railsMerge でまとめるときに一番上の D1 に来たやつが seam になることを自力で発見したので、これを使えばうまいこと選べることがわかった。

どんどん自動化していっていろいろな形状を比較、とかやってみたいところ。

Twitter で Grasshopper に強そうな人を何人かフォローしてみたけど、どうやら建築系の方が多いみたいだ。ていうか Rhino に強そうな人もフォローしておくべきだったな…いまさらだけど。

ANSYS Designmodeler: "Heal" when importing external geometry (e.g., IGES, STEP) can be hazardous

I noticed a wingtip of my bird model (STEP file) is hugely distorted when I set the Heal to Yes when importing external geometry in ANSYS DesignModeler (v 19.1). Therefore, from now on, I will use Heal = No as the first choice. On the other hand, Clean = No almost always fails so I'll be using Clean = Normal as the first choice.

ORS Dragonfly 4.1: "Keep same geometry" crops your slices (Z-direction) as well as XY, so be careful

In ORS Dragonfly Image Loader, there's an option Import another dataset… which is useful if you need to load more than 1 dataset with different settings, e.g., different cropping. If you do that, the cropping ROI is reset every time. Sometimes you may want to start from the same ROI, which is possible with Keep same geometry… option. And I though "oh this is convenient." However, this option must be used with caution.

Imagine you at first loaded 100 slices (images), set the cropping ROI, and turned on both Import another dataset… and Keep same geometry… options. Then you tried to load 300 images this time. Adjusted the cropping ROI. Done. What happens is quite surprising (to me at least). The 1st dataset is intact. The 2nd dataset loads only the first 100. This is presumably because the software "tried to keep the same geometry." But somehow I thought that only applies to XY geometry. I never imagined that some slices were not loaded w/o any caution or warning at all. But it seems to me this is the current behaviour. I already reported this to the developer so it might be changed in the next release. Until then, be careful when you use the option...

Rhinoceros with python script: CurveThroughPoints (rs.AddInterpCurve) after sorting the points

Background

I have a few points with witch I want to make a CurveThroughPoints. This is not a problem when doing it manually but when I tried that with python script using rs.AddInterpCurve, it generated strange looping curve. It's quite obvious the order of the points *1 is used for drawing the curve, instead of using the distance to the next point which is likely to be used in the CurveThroughPoints. Therefore, to my understanding, I have to sort the points by myself. So I did that.

Code

Assuming you have a layer "pts_test1" containing the points, and an empty layer "crv_test1" where your resultant curve will be placed.

def make_curve_through_points(layer_name_pts, layer_name_crv, deg, ktstyle):
    ## Obtain the GID of the points
    rs.CurrentLayer(layer_name_crv)
    id_points = rs.ObjectsByLayer(layer_name_pts, True)

    ## Obtain 3D coordinates of each point
    points_3d = []
    for i in range(0, len(id_points)):
        points_3d.append( rs.PointCoordinates(id_points[i]) )

    ## Sort the points
    points_sorted = rs.SortPointList(points_3d)

    ## Generate the curves
    rs.AddInterpCurve(points_sorted, degree=deg, knotstyle=ktstyle, start_tangent=None, end_tangent=None)


## Sample usage
layer_name_pts = "pts_test1"
layer_name_crv = "crv_test1"
deg = 3
ktstyle = 1
make_curve_through_points(layer_name_pts, layer_name_crv, deg, ktstyle)

Instead of using SortPointList, directly specifying the direction with SortPoints might be necessary depending on the situation.

References

*1:Perhaps the order of generations of the points, which is held internally and cannot be seen...