Quantcast
Channel: Rhino Developer - McNeel Forum
Viewing all 8532 articles
Browse latest View live

GetObject selection behavior

$
0
0

I finally decided to try some Rhino (6/mac) scripting, with a simple tool to export paths as gcode. It mostly works well, but I have had a lot of difficulty understanding how to get the selection behavior I want.

It would be great if anyone could suggest a resource that explains this topic in general. The RhinoCommon documentation lists a ton of methods and properties related to selection, but it is not at all clear how they interact, and I managed to crash Rhino quite a lot by trying to experiment.

My specific, current problem is that I need the user to pick objects one by one in a specific order, and I want to select the objects as they are picked – partly to provide feedback, and partly because it shouldn’t be possible to pick the same object twice. The OneByOnePostSelect property gives me part of this behavior, but the objects are not visibly selected when I pick them, and if I call rhinoscriptsyntax.SelectObject() on the picked ObjectRef, nothing happens.

I’ve attached my script below – hopefully it is understandable, but it will probably be obvious to Rhino experts that I haven’t used these APIs (or python) before!

import rhinoscriptsyntax as rs
import Rhino

gcodeFile = None
feedrate = 1500.0
spindle = 10000.0
retractHeight = 6.0
tool = 0
jobOrigin = 0
firstPath = True
gcodeState = dict(
    x = 0,
    y = 0,
    z = 0,
    f = 0
    )



# prompt for an output location and setup origin, and then repeatedly
# prompt for toolpaths and machine settings to write to the file in order
def event_loop():
    global gcodeFile
    global feedrate
    global spindle
    global retractHeight
    global tool
    global jobOrigin
    global firstPath
    filename = rs.SaveFileName(
        title = "Export G Code",
        filter = "G Code File (*.nc)|*.nc|All files (*.*)|*.*||",
        filename = "Untitled",
        extension = "nc"
        )
    if not filename: return
    gcodeFile = open(filename, "w")
    jobOrigin = rs.GetPoint("Select toolpath origin")
    prompt = Rhino.Input.Custom.GetObject()
    feedrateOption = Rhino.Input.Custom.OptionDouble(feedrate, 1.0, 5000)
    prompt.AddOptionDouble("Feed", feedrateOption, "New feed rate (mm/min)")
    spindleOption = Rhino.Input.Custom.OptionDouble(spindle, 0, 10000.0)
    prompt.AddOptionDouble("Speed", spindleOption, "New spindle speed (rpm)")
    retractOption = Rhino.Input.Custom.OptionDouble(retractHeight, 0, 100.0)
    prompt.AddOptionDouble("RetractHeight", retractOption, "Safe retract height (mm)")
    toolOption = Rhino.Input.Custom.OptionInteger(tool, 0, 1000)
    prompt.AddOptionInteger("Tool", toolOption, "Tool number")
    prompt.AcceptNothing(True)
    prompt.EnablePreSelect(False, True)
    prompt.OneByOnePostSelect = True
    prompt.SetCommandPrompt("Select first toolpath curve")
    prompt.GeometryFilter = Rhino.DocObjects.ObjectType.Curve
    while True:
        rc = prompt.Get()
        if prompt.CommandResult() != Rhino.Commands.Result.Success:
            return prompt.CommandResult()
        if rc == Rhino.Input.GetResult.Object:
            curveRef = prompt.Object(0)
            if not curveRef: return Rhino.Commands.Result.Failure
            append_toolpath(curveRef)
            if firstPath:
                firstPath = False
                prompt.SetCommandPrompt("Select next toolpath curve")
            continue
        elif rc == Rhino.Input.GetResult.Option:
            opt = prompt.OptionIndex()
            if feedrateOption.CurrentValue != feedrate:
                feedrate = feedrateOption.CurrentValue
            if spindleOption.CurrentValue != spindle:
                spindle = spindleOption.CurrentValue
                if not firstPath: gcodeFile.write("M3 S{}\n".format(gcs(spindle)))
            if retractHeight != retractOption.CurrentValue:
                retractHeight = retractOption.CurrentValue
            if tool != toolOption.CurrentValue:
                tool = toolOption.CurrentValue
                gcodeFile.write("M6 T{:d}\n".format(tool))
            continue
        elif rc == Rhino.Input.GetResult.Nothing:
            close_file()
            print ("Exported GCode to "+filename)
            break
        elif rc == Rhino.Input.GetResult.Cancel:
            #TODO use a temp file so it's actually possible to cancel export...
            close_file()
            print ("GCode Export cancelled")
        break

    return Rhino.Commands.Result.Success




#format numbers for CNC without wasting bytes
def gcs(num): return "{:.99g}".format(round(num,3))

#convert Rhino units to mm
def rtomm(n): return n * rs.UnitScale(2)

#convert mm to Rhino units
def mmtor(n): return n / rs.UnitScale(2)




# write out G code for initial setup and tool positioning
# (once we know where the first toolpath begins)
def write_prefix(startX=0, startY=0):
    global gcodeState
    gcodeFile.write("\n".join((
        "G21 (distances in mm)",
        "G90 (absolute coords)",
        "G17 (use XY plane for arcs)",
        "G0 Z" + gcs(retractHeight) + " (rapid to safe height)",
        "G0 X" + gcs(startX) + " Y" + gcs(startY) + " (rapid to start XY)",
        "M3 S" + gcs(spindle) + " (run spindle clockwise)",
        "",
        )))
    gcodeState['x'] = startX
    gcodeState['y'] = startY
    gcodeState['z'] = retractHeight
    return



# write out G code for a toolpath, prepending commands to
# move the tool safely (you hope) from its previous position
def append_toolpath(curveRef):
    global gcodeState
    curve = curveRef.Curve()
    if rs.IsPolyline(curve):
        polyline = curve
    else:
        polyline = rs.ConvertCurveToPolyline(curve, 5.0, mmtor(0.01), False)
    points = rs.PolylineVertices(polyline)
    point = rs.PointSubtract(points[0], jobOrigin)
    if firstPath:
        write_prefix(point.X, point.Y)
    else:
        gcodeFile.write("G1 Z{}\nG0 X{} Y{}\n".format(
            gcs(retractHeight),
            gcs(point.X),
            gcs(point.Y)
            ))
    gcodeFile.write("\n(toolpath {}mm)\n".format(gcs(rs.CurveLength(curve))))
    for i in range(len(points)):
        point = rs.PointSubtract(points[i], jobOrigin)
        write_G1(point)
    if not rs.IsPolyline(curve): rs.DeleteObject(polyline)
    rs.SelectObject(curveRef)
    return


# write out a G1 command (single linear move) in a compact form,
# setting the X,Y,Z and F parameters only where they have changed
def write_G1(dest):
    epsilon = mmtor(0.001)
    if rs.Distance(dest, (gcodeState['x'],gcodeState['y'],gcodeState['z'])) < epsilon:
        return
    cmd = "G1 "
    sep = ""
    if abs(dest.X - gcodeState['x']) > epsilon:
        cmd += "X" + gcs(rtomm(dest.X))
        gcodeState['x'] = dest.X
        sep = " "
    if abs(dest.Y - gcodeState['y']) > epsilon:
        cmd += sep + "Y" + gcs(rtomm(dest.Y))
        gcodeState['y'] = dest.Y
        sep = " "
    if abs(dest.Z - gcodeState['z']) > epsilon:
        cmd += sep + "Z" + gcs(rtomm(dest.Z))
        gcodeState['z'] = dest.Z
        sep = " "
    if feedrate != gcodeState['f']:
        cmd += sep + "F" + gcs(feedrate)
        gcodeState['f'] = feedrate
    gcodeFile.write(cmd + "\n")
    return



# move tool to a safe height, write final commands and close file
def close_file():
    gcodeFile.write ("G1 Z" + gcs(retractHeight) + "\n\n")
    gcodeFile.write ("M5 (stop spindle)\nM30 (program end)\n")
    gcodeFile.close()
    return



if(__name__ == "__main__"):
    event_loop()

gcExport.py (6.2 KB)

2 posts - 2 participants

Read full topic


Cannot open form in design mode in Visual Studio

$
0
0

This has been an on-going issuefor years, which I can normally get around by opening, closing, cleaning, compiling the project until the RenderContentUserControlCollapsibleSection form will finally open. But now I am stuck and I absolutely cannot open my form in Visual Studio. The project compiles without error.

namespace PhysicalcSoftware.OctaneRender.RhinoPlugin
{
    [System.Runtime.InteropServices.Guid("25DA894E-91E4-4866-8426-47662116AC45")]
    public partial class OctaneMaterialTreeControl : RhinoWindows.Controls.RenderContentUserControlCollapsibleSection
    { // etc

Thanks

Paul

1 post - 1 participant

Read full topic

Creating HUD for information of plugin objects

$
0
0

Hi everyone,

I am developing plugin that already functional as desired for now. I want to add HUD feature for that. I was looking samples and documentation about that but a bit confused when I try to impement HUD.

  1. I created MyPluginDisplayMode object inherited from RealtimeDisplayMode object to use HUDs. (I didn’t add any implementation for overriden methods come from RealtimeDisplayMode)
  2. I registered this object as MyPluginDisplayMode.RegisterDisplayModes(PlugIn);
  3. I initialized it in MyPluginViewModel object which is inherited from Rhino.UI.ViewModel
  4. Lastly I used this method variableName.HudShow();

When I open my plugin in rhino nothing initializing, what I am missing something in structure?

I want to achieve below image

Thanks in advance
-Oguzhan

1 post - 1 participant

Read full topic

base.OnShutdown() takes seconds

$
0
0

Hi!

When we close Rhino, in our development machines, it takes seconds from base.OnShutdown().

Do you know how I can find what is the reason? I don’t have installed other plugins than 2Shapes for Rhino.

Thanks,

1 post - 1 participant

Read full topic

Mesh Topology Error C#

$
0
0

I have created a MeshBox Using its 8 Vertices. That I have in specific order.
But When I try to access the VertexTopology again in another component. it shows a different order of Points than the one I set it with.

Here is the Code

  {

    Plane mPlane = new Plane(basePlane, Plane.WorldXY.XAxis, Plane.WorldXY.YAxis);
    
    ICModule myModule = new ICModule(mPlane, width, depth, height);
    Mesh iModule = myModule.CreateBaseModule();

    A = iModule;
   // B = mPlane2;

  }

  // <Custom additional code> 

  public class ICModule
  {
    public Plane BasePlane = Plane.WorldXY;
    public double Width = 1.0;
    public double Depth = 1.0;
    public double Height = 1.0;

    //Create default constructor method/function
    public ICModule(double width, double depth, double height)
    {
      Width = width;
      Depth = depth;
      Height = height;
    }

    //Create method/function overload to be used in different situation
    //We can create more functions to make modules using the assigned variables with different inputs
    public ICModule(Plane basePlane, double width, double depth, double height)
    {
      BasePlane = basePlane;
      Width = width;
      Depth = depth;
      Height = height;
    }   

    public Mesh CreateBaseModule()
    {
      //Generate the Mesh Vertices
      List<Point3d> meshVertices = new List<Point3d>();
      {
        meshVertices.Add(BasePlane.Origin);                                                                                         
        meshVertices.Add(BasePlane.Origin + BasePlane.XAxis * Width);                                                               
        meshVertices.Add(BasePlane.Origin + BasePlane.XAxis * Width + BasePlane.YAxis * Depth);                                     
        meshVertices.Add(BasePlane.Origin + BasePlane.YAxis * Depth);                                                               
        meshVertices.Add(BasePlane.Origin + BasePlane.ZAxis * Height);                                                              
        meshVertices.Add(BasePlane.Origin + BasePlane.XAxis * Width + BasePlane.ZAxis * Height);                                    
        meshVertices.Add(BasePlane.Origin + BasePlane.XAxis * Width + BasePlane.YAxis * Depth + BasePlane.ZAxis * Height);          
        meshVertices.Add(BasePlane.Origin + BasePlane.YAxis * Depth + BasePlane.ZAxis * Height);                                    
      }
      Mesh outModule = Mesh.CreateFromBox(meshVertices, 1, 1, 1);


      return outModule;
    }
  }

  // </Custom additional code> 
}

Here in the image you can see the vertex topology on right(Expectation) on left( actual)

Any Idea how to fix it.

Attached is the Script.MeshTopologyExercise.gh (5.9 KB)
MeshTopologyExercise.3dm (36.7 KB)

1 post - 1 participant

Read full topic

Events and snapshots

$
0
0

HI, I’m trying to figure out some way to my script be aware of when the user is messing around with snapshot (in my current problem I need to be aware if the user has fired up snapsphots “Restore” button since I need to take care of additional scene states related to third party plugins that currently snapshot is not supporting.

So far, I didn’t found any events related to snapshot. Did I miss something? Is it any plans to implement events for snapshots?

I would like to hear what would be the best way to solve the problem I described earlier?

thanks
aitor

2 posts - 1 participant

Read full topic

Export FBX

Image Order


[Papercut?] MeshLine intersection point order

$
0
0

There’s a small papercut that took me quite long to figure out:
for since for 99% of the cases Rhino.Geometry.Intersect.Intersection returns points in the same order as the line you cut with (from start to end). And in some cases they don’t.

I’m not sure f this was the intended behavior, and the solution for it this problem is trivial, but figuring out the behavior was not. A small note in the documentation that the point order can be random could be an improvement.

Attached is a grasshopper file to reproduce this behavior
MeshLineBug.gh (1.9 MB)

1 post - 1 participant

Read full topic

ExtrudeCrvTapered direction vector definition

$
0
0

How do I structure the Direction parameters for ExtrudeCrvTapered?

In my RhinoCommon plugin I’m sending the command:
“_-ExtrudeCrvTapered 2 _DraftAngle=2 _Solid=_Yes _Corners=_Sharp _DeleteInput=_Yes _Enter”

to RhinoApp.RunScript() and I’m getting the response:

Command: _-ExtrudeCrvTapered
Extrusion distance <1> ( Direction DraftAngle=2 Solid=Yes Corners=Sharp DeleteInput=Yes FlipAngle ToBoundary SetBasePoint ): 2
Command: _DraftAngle=2
Unknown command: _DraftAngle=2

It seems I need to supply a defintion for a direction vector but anything I put ahead of the DraftAngle parameter causes an “Unknown command” response. I’ve tried lots of variations of _Direction parameters without success for defining a direction vector.

The syntax example would be appreciated. I’ve not found an example in my searches.

Thanks,
Bob

2 posts - 2 participants

Read full topic

Python to create some entities, create a block and insert

$
0
0

As a newby in Python I have made a function to create a so called BaseLine (for use in Ship designs). I want to create a block directly from the new entities and insert it. I can’t find a example script to help me create a block from generated entities. The examples I found are all based on user selection first and that is not what I want. Can anybody show how to do it with a couple of different entities like a line,a circle and a text?

Thanks in advance, Erik

1 post - 1 participant

Read full topic

Command Events - C#

$
0
0

Hi everyone,

I have quick question that I couldn’t find answer. In my plugin, I create some geometries as plugin object, but I want to update them with some Scale1D, Scale2D etc. commands. What kind of event structure should I use? According to my research, there is no any command-specific events, right?

Thanks in advance,
-Oğuzhan

1 post - 1 participant

Read full topic

Wrong link on developer.rhino3d.com

$
0
0

On this page, Check out the Rhino 6 version instead links to the page itself, instead of Rhino 6’s landing page.

2 posts - 2 participants

Read full topic

How to check if a curve intersect with anything?

$
0
0

Hello.
I have problem, that would be easier to solve if I can check if a curve ever intersect with another. I know how to check between two curve using Rhino.Geometry.Intersect.Intersection.CurveCurve. What I want is that I have a curve then know if that curve ever intersect with another, then give me something (may be a list) about the intersection and with which curve. As I have lot of curves, I don’t like to iterating them one by one to check intersection if possible. Can anyone help? I’m using python for this.
Thanks in advanced.

6 posts - 3 participants

Read full topic

How to "redraw" the viewportControl

$
0
0

Hi all,
I have a ETO UI with a viewportControl. I need the viewportControl camera to be set programatically, similar to rhino’s savedView user experience…

I managed to set the viewportControl’s viewport’s camera (location, direction and lens values) but I can’t figure out how I can refresh the viewport. In other projects I have used the RhinoView’s Redraw() method, but since I’m working with viewportControl, there is no RhinoView for “redrawing”.

How can I “refresh” or “redraw” the viewport of a viewportControl?

    def onRestoreItemClick(self,sender,e):
        try:
            selectedIndex = self.viewListBox.SelectedIndex
            selectedView = self.viewModel.views[selectedIndex]
            self.vp.Viewport.SetCameraLocation(selectedView.location,False)
            self.vp.Viewport.SetCameraDirection(selectedView.direction,False)
            self.vp.Viewport.Camera35mmLensLength = seletectedView.lens
            self.vp.Refresh() #NO LUCK WITH REFRESH...THIS IS NO REDRAWING NOTHING
        except Exception as e:
            Rhino.RhinoApp.WriteLine(str(e))

5 posts - 4 participants

Read full topic


Python Scripting

$
0
0

Hi guys,

I am new to python scripting for grasshopper so please don’t judge the terrible first time attempt :smiley:

Can somebody have a look at the grasshopper script in the attached picture and explain to me how that can be achieved in python please. The fake script i attempted has also been attached.

I think my main problem at the moment understanding how to use the input and outputs from a component inside of python. It will be really appreciated if someone can explain that to me please. I will also appreciate if someone attempts to write the background script in python so that I can see where I am currently going wrong.

I’ve been fighting with this script for a few days now with no luck whatsoever :sob:

Thank you guys.Python.gh (17.2 KB)

5 posts - 2 participants

Read full topic

GHGumball Output Error C#

$
0
0

I saw this post sometime ago about the AddGumball https://wiki.mcneel.com/developer/rhinocommonsamples/gumball
And I have been exploring the Conduit and gumball in Grasshopper to move grasshopper preview points using GumballDisplayConduit. Everything seems to be working fine as I don’t get any errors. but when I select a point and drag it, it does not update the position.
Here is the code

private void RunScript(List<Point3d> pts, bool on, object clear, ref object A)
  {
    List<Line> outLines = new List<Line>();
    if (on)
    {
      stickyData = ManipulatePoints(pts);

      var toggle = this.Component.Params.Input[1].Sources[0];
      ((GH_BooleanToggle) toggle).Value = false;
      toggle.ExpireSolution(true);
    }

    if (stickyData.Count > 0)
    {
      if ((bool) clear) stickyData.Clear();
      foreach (var i in stickyData.Keys)
        pts[i].Transform(stickyData[i]);
    }
    A = pts;
  }

  // <Custom additional code> 
  Dictionary<int, Transform> stickyData = new Dictionary<int, Transform>();

  private GumballAppearanceSettings CustomGumballAppearanceSettings()
  {
    //Return Gumball Appearance Settings with only Translation
    var gas = new GumballAppearanceSettings
      {
        RotateXEnabled = false,
        RotateYEnabled = false,
        RotateZEnabled = false,
        ScaleXEnabled = false,
        ScaleYEnabled = false,
        ScaleZEnabled = false,
        TranslateXEnabled = true,
        TranslateXYEnabled = true,
        TranslateYEnabled = true,
        TranslateYZEnabled = true,
        TranslateZEnabled = true,
        TranslateZXEnabled = true,
        MenuEnabled = false,
        RelocateEnabled = false
        };
    return gas;
  }

  class CustomGetTransform : GetTransform
  {
    public GumballDisplayConduit lineDc;
    private readonly List<Point3d> ptsToSelectFrom;
    public int currentSelIndex;
    public readonly Dictionary<int, Transform> info;

    public CustomGetTransform(GumballDisplayConduit inLineDc, List<Point3d> inPtsToSelectFrom)
    {
      lineDc = inLineDc;
      ptsToSelectFrom = inPtsToSelectFrom;
      currentSelIndex = -1;
      info = new Dictionary<int, Transform>();
    }

    public override Transform CalculateTransform(RhinoViewport viewport, Point3d point)
    {
      // do we want this first line??
      //if (lineDc.InRelocate) return lineDc.PreTransform;
      return lineDc.TotalTransform;
    }

    protected override void OnMouseDown(GetPointMouseEventArgs e)
    {
      //initial mouse down event
      if (lineDc.PickResult.Mode != GumballMode.None)
        return;

      lineDc.PickResult.SetToDefault();

      var picker = new PickContext
        {
          View = e.Viewport.ParentView,
          PickStyle = PickStyle.PointPick
          };

      var xform = e.Viewport.GetPickTransform(e.WindowPoint);
      picker.SetPickTransform(xform);

      //Point Selection

      for (int i = 0; i < ptsToSelectFrom.Count; i++)
      {
        double depth;
        double distance;
        if (picker.PickFrustumTest(ptsToSelectFrom[i], out depth, out distance))
        {
          currentSelIndex = i;
          if (!info.ContainsKey(i))
            info.Add(i, Transform.Identity);
          break;
        }
      }
      //Gumball
      Line pickLine;
      e.Viewport.GetFrustumLine(e.WindowPoint.X, e.WindowPoint.Y, out pickLine);

      picker.PickLine = pickLine;
      picker.UpdateClippingPlanes();
      lineDc.PickGumball(picker, this);
    }

    private void updateSelectedPoint(Transform xform)
    {
      //Update the Selected Point and info Dictionary
      var pt = ptsToSelectFrom[currentSelIndex];
      pt.Transform(xform);
      info[currentSelIndex] *= xform;
    }

    protected override void OnMouseMove(GetPointMouseEventArgs e)
    {
      //Update the Gumball in the Display Conduit
      if (lineDc.PickResult.Mode == GumballMode.None) return;
      //lineDc.CheckShiftAndControlKeys();
      Line worldLine;
      var res = e.Viewport.GetFrustumLine(e.WindowPoint.X, e.WindowPoint.Y, out worldLine);
      if (!res)
        worldLine = Line.Unset;
      var rc = lineDc.UpdateGumball(e.Point, worldLine);
      if (rc)
        base.OnMouseMove(e);
    }




    public GetResult MoveGumball()
    {
      // Get point on a MouseUp event
      if (lineDc.PreTransform != Transform.Identity)
      {
        HaveTransform = true;
        Transform = lineDc.PreTransform;
      }
      SetBasePoint(lineDc.BaseGumball.Frame.Plane.Origin, false);

      // V5 uses a display conduit to provide display feedback
      // so shaded objects move
      //ObjectList.DisplayFeedbackEnabled = true;
      if (this.Transform != Transform.Identity)
      {
        //ObjectList.UpdateDisplayFeedbackTransform(Transform);
        updateSelectedPoint(this.Transform);
      }

      // Call Get with mouseUp set to true
      var rc = this.Get(true);

      // V5 uses a display conduit to provide display feedback
      // so shaded objects move
      //ObjectList.DisplayFeedbackEnabled = false;
      return rc;
    }

    protected override void OnDynamicDraw(GetPointDrawEventArgs e)
    {
      foreach (var i in info.Keys)
        e.Display.DrawPoint(ptsToSelectFrom[i], PointStyle.X, 5, System.Drawing.Color.Green);
    }
  }

  private Dictionary<int, Transform> ManipulatePoints(List<Point3d> ptsToSelectFrom)
  {
    var conduit = new GumballDisplayConduit();
    var baseGumball = new GumballObject();
    var cgt = new CustomGetTransform(conduit, ptsToSelectFrom);
    cgt.SetCursor(CursorStyle.Default);
    cgt.lineDc.Enabled = true;

    while (true)
    {
      if (cgt.currentSelIndex >= 0)
      {
        var currentSelPt = ptsToSelectFrom[cgt.currentSelIndex];
        if (conduit.PickResult.Mode == GumballMode.None)
          baseGumball.SetFromPlane(new Plane(currentSelPt, Vector3d.ZAxis));
        conduit.SetBaseGumball(baseGumball, CustomGumballAppearanceSettings());
        conduit.Enabled = true;
        cgt.lineDc = conduit;
        cgt.SetCommandPrompt("Drag gumball or select another point. (<ESC> to exit)");
        cgt.MoveGumball();
        conduit.Enabled = false;
      }
      else
      {
        cgt.SetCommandPrompt("Select grasshopper points. (<ESC> to exit)");
        cgt.Get(true);
      }
      RhinoDoc.ActiveDoc.Views.Redraw();
      if (cgt.CommandResult() != Result.Success)
      {
        cgt.lineDc.Enabled = false;
        return cgt.info;
      }
      if (cgt.Result() == GetResult.Point)
      {
        // update base gumball
        var gbFrame = conduit.Gumball.Frame;
        var baseFrame = baseGumball.Frame;
        baseFrame.Plane = gbFrame.Plane;
        baseGumball.Frame = baseFrame;
      }

    }
  }

Here is the preview of viewport

Also the GH file is attached. GH_GumballTest.gh (10.1 KB)

1 post - 1 participant

Read full topic

Draw3dtext line breaks bug

$
0
0

The TextHorizontalAlignment only works for the first line using:
https://developer.rhino3d.com/api/RhinoCommon/html/M_Rhino_Display_DisplayPipeline_Draw3dText_1.htm

It seems that any alignment only works properly with the first line.

    var text = "Hello" + Environment.NewLine + "World";
    //var text = "Hello\nWorld";
   
    args.Display.Draw3dText(text, args.WireColour, 
      Plane.WorldXY, 1, "Arial", false, false, 
      Rhino.DocObjects.TextHorizontalAlignment.Center,
      Rhino.DocObjects.TextVerticalAlignment.Top);

Version 6 SR25
(6.25.20114.5271, 04/23/2020)

Related:

1 post - 1 participant

Read full topic

IntersectBreps without draw curves

$
0
0

There is any away to check the IntersectBreps (trimed surfaces) wihout draw the curves?

I have a loop that check and delete it right away, but even with redraw deactivated, it creates a slight delay that I would like to eliminate.

Any other away?

1 post - 1 participant

Read full topic

DisplayPipeline Draw Extrusion shaded

$
0
0

I’m seeking to be able to render shaded extrusions to a display pipeline.
I haven’t found any methods for extrusions (ie DrawMeshShaded for Mesh).
Is it intentional to not have a method for extrusions? If so, is it then suggested a way to extract a light weight mesh, cache and use that instead?

Thanks,

Jon

1 post - 1 participant

Read full topic

Viewing all 8532 articles
Browse latest View live