Skip to content

Instantly share code, notes, and snippets.

View nezix's full-sized avatar

Xavier M nezix

View GitHub Profile
@nezix
nezix / NanomeMesh.py
Created May 31, 2023 10:56
Nanome plugin code to load a 3D mesh
import nanome
from nanome.util import Color, Logs, Vector3
from nanome.api import shapes
import numpy as np
import open3d as o3d
class OBJLoader(nanome.PluginInstance):
def start(self):
path = "mypath.obj"
@nezix
nezix / UnityMol_ChangeLog.md
Last active November 10, 2021 10:07
Current UnityMol changelog

UnityMol Changelog

[1.1.3] - 2021-02-10

  • [Feature] Add orthographic camera mode
  • [Feature] Serialization: export the current UnityMol state to a JSON file (selections, representations, annotations) !
  • [VR|Feature] LeapMotion support re-added
  • [Feature] Tour feature: long click on a selection to add it to the tour animation
  • [Feature] Call python functions each frame of a trajectory: last().NewFrameDeleg += myPythonfunc
  • [Feature] Energy plots for IMD
using UnityEngine;
[RequireComponent(typeof(MeshFilter))]
public class NormalsVisualizer : MonoBehaviour {
private Mesh mesh;
private string curName = "";
private Mesh debugMesh;
private GameObject curGo;
@nezix
nezix / UMolAPI.md
Last active May 5, 2022 21:11
UnityMol API functions

UnityMol 1.1.3

# Fetch a remote molecular file (pdb or mmcif zipped)
# forceStructureType (-1 = auto-detect / 0 = standard / 1 = CG / 2 = OPEP / 3 = HIRERNA)

UnityMolStructure fetch(string PDBId, bool usemmCIF = True, bool readHetm = True, bool forceDSSP = False, bool showDefaultRep = True, bool center = True, bool modelsAsTraj = True, int forceStructureType = -1, bool bioAssembly = False) 
# Load a local molecular file (pdb/mmcif/gro/mol2/sdf/xyz formats)
@nezix
nezix / WireframeGenerator.cs
Created October 9, 2019 15:38
Wireframify a mesh using the C# job system + Burst compiler
using UnityEngine;
using Unity.Collections;
using Unity.Jobs;
using Unity.Mathematics;
using Unity.Collections.LowLevel.Unsafe;
using Unity.Burst;
public class WireframeGenerator {